Skip to content

Commit

Permalink
[1.20.1] Publish using GH Actions (#84)
Browse files Browse the repository at this point in the history
Co-authored-by: Matyrobbrt <[email protected]>
  • Loading branch information
embeddedt and Matyrobbrt authored Feb 1, 2024
1 parent ea1e834 commit ebcc524
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 178 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and test PRs

on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
fetch-tags: true

- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
branches: [ "1.20.1" ]

permissions:
contents: read
statuses: write

jobs:
build:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 17
gradle_tasks: 'publish'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
104 changes: 0 additions & 104 deletions .teamcity/pom.xml

This file was deleted.

71 changes: 0 additions & 71 deletions .teamcity/settings.kts

This file was deleted.

23 changes: 20 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ plugins {
id 'net.neoforged.gradleutils' version '[2.0.18,3)'
}

changelog {
disableAutomaticPublicationRegistration()
}

allprojects {
apply plugin: 'java-library'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'

apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'org.javamodularity.moduleplugin'
Expand All @@ -34,7 +39,12 @@ allprojects {

dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) }

java.withSourcesJar()
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

test {
useJUnitPlatform()
Expand All @@ -52,9 +62,7 @@ subprojects { subProject ->

jar.doFirst {
manifest.attributes(
'Timestamp' : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit' : gradleutils.gitInfo.abbreviatedId,
'Git-Branch' : gradleutils.gitInfo.branch,
'Build-Number': "${subProject.version}",
'Automatic-Module-Name' : "fml_${subProject.name.replace("-", "_")}",
'FMLModType' : subProject.name.startsWith("language") ? 'LANGPROVIDER' : subProject.name == "events" ? 'GAMELIBRARY' : 'LIBRARY',
Expand Down Expand Up @@ -94,6 +102,15 @@ subprojects { subProject ->
}
}

if (System.getenv('GPG_PRIVATE_KEY')) {
signing {
final signingKey = System.getenv('GPG_PRIVATE_KEY') ?: ''
final signingPassword = System.getenv('GPG_KEY_PASSWORD') ?: ''
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}
}

changelog {
fromTag "47.1"
}
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit ebcc524

Please sign in to comment.