diff --git a/.github/workflows/build-prs.yml b/.github/workflows/build-prs.yml index 764689e..bb62a6c 100644 --- a/.github/workflows/build-prs.yml +++ b/.github/workflows/build-prs.yml @@ -1,3 +1,6 @@ +# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly +# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/build-prs.yml + name: Build and test PRs on: @@ -7,24 +10,14 @@ on: - opened - ready_for_review - reopened + push: + branches: + - 'feature/**' + workflow_dispatch: jobs: build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1000 - fetch-tags: true - - - name: Setup JDK 8 - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'temurin' - - - name: Build with Gradle - uses: gradle/gradle-build-action@v2 - with: - arguments: build \ No newline at end of file + uses: neoforged/actions/.github/workflows/build-prs.yml@main + with: + java: 8 + gradle_tasks: test \ No newline at end of file diff --git a/.github/workflows/publish-prs.yml b/.github/workflows/publish-prs.yml new file mode 100644 index 0000000..1643661 --- /dev/null +++ b/.github/workflows/publish-prs.yml @@ -0,0 +1,29 @@ +# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly +# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/publish-prs.yml + +name: Publish PRs to GitHub Packages + +on: + workflow_run: + workflows: [Build and test PRs] + types: + - completed + issue_comment: + types: + - edited + pull_request_target: + types: + - opened + +permissions: + packages: write + +jobs: + publish-prs: + if: true + uses: neoforged/actions/.github/workflows/publish-prs.yml@main + with: + artifact_base_path: net/neoforged/mergetool/ + secrets: + PR_PUBLISHING_GH_APP_ID: ${{ secrets.PR_PUBLISHING_GH_APP_ID }} + PR_PUBLISHING_GH_APP_KEY: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4590ec..c77e47b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,6 @@ +# File generated by the GradleUtils `setupGitHubActionsWorkflows` task, avoid modifying it directly +# The template can be found at https://github.com/neoforged/GradleUtils/blob/44d9e09cfa2c6032b84ac40495ea5ab7d64fe521/src/actionsTemplate/resources/.github/workflows/release.yml + name: Release on: @@ -9,17 +12,17 @@ permissions: statuses: write jobs: - build: + release: uses: neoforged/actions/.github/workflows/gradle-publish.yml@main with: java: 8 - pre_gradle_tasks: 'licenseFormat build' - gradle_tasks: 'publish' + pre_gradle_tasks: test + 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 }} \ No newline at end of file + GPG_SUBKEY: ${{ secrets.GPG_SUBKEY }} + GPG_SUBKEY_ID: ${{ secrets.GPG_SUBKEY_ID }} + GPG_SUBKEY_PASSWORD: ${{ secrets.GPG_SUBKEY_PASSWORD }} + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 851131c..889047b 100644 --- a/build.gradle +++ b/build.gradle @@ -7,12 +7,18 @@ plugins { id 'org.cadixdev.licenser' version '0.6.1' id 'com.github.johnrengelman.shadow' version '8.1.1' id 'com.github.ben-manes.versions' version '0.47.0' - id 'net.neoforged.gradleutils' version '2.+' + id 'net.neoforged.gradleutils' version '3.0.0-alpha.10' id 'signing' } group = 'net.neoforged' -version = gradleutils.getTagOffsetVersion() +gradleutils { + version { + branches.suffixBranch() + } + setupSigning(signAllPublications: true) +} +version = gradleutils.version println "Version: $version" repositories { @@ -138,19 +144,10 @@ publishing { } } repositories { - maven gradleutils.getPublishingForgeMaven() - } -} - -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.mavenJava + maven gradleutils.publishingMaven } } changelog { - fromTag '2.0' + from '2.0' }