Skip to content

Commit

Permalink
Update CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Mar 7, 2024
1 parent be34907 commit e8c0a18
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 38 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 8
gradle_tasks: test
29 changes: 29 additions & 0 deletions .github/workflows/publish-prs.yml
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
GPG_SUBKEY: ${{ secrets.GPG_SUBKEY }}
GPG_SUBKEY_ID: ${{ secrets.GPG_SUBKEY_ID }}
GPG_SUBKEY_PASSWORD: ${{ secrets.GPG_SUBKEY_PASSWORD }}

23 changes: 10 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
}

0 comments on commit e8c0a18

Please sign in to comment.