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 19dda0b commit 933f0b4
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 36 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/licenser/
secrets:
PR_PUBLISHING_GH_APP_ID: ${{ secrets.PR_PUBLISHING_GH_APP_ID }}
PR_PUBLISHING_GH_APP_KEY: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
16 changes: 10 additions & 6 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,16 +12,17 @@ permissions:
statuses: write

jobs:
build:
release:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 8
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 }}

22 changes: 10 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'signing'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.5.1'
id 'net.neoforged.gradleutils' version '[2.0.18,3)'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.10'
}

java {
Expand All @@ -14,7 +14,13 @@ java {
}

group = 'net.neoforged.licenser'
version = gradleutils.getTagOffsetVersion()
gradleutils {
version {
branches.suffixBranch()
}
setupSigning(signAllPublications: true)
}
println "Version: ${version = gradleutils.version}"
description = 'A simple license header manager for Gradle'

repositories {
Expand Down Expand Up @@ -137,15 +143,7 @@ publishing {
}
}

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.pluginMaven
}
}

changelog {
fromTag '0.7'
from '0.7'
disableAutomaticPublicationRegistration()
}

0 comments on commit 933f0b4

Please sign in to comment.