Skip to content

Commit

Permalink
Publishing setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Dec 30, 2023
1 parent 10d1074 commit 627f2da
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 115 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
push:
branches:
- 'feature/**'
workflow_dispatch:

jobs:
build:
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 17
gradle_tasks: test
43 changes: 0 additions & 43 deletions .github/workflows/main.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/pr.yml

This file was deleted.

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: false # Option not enabled when the workflows were generated
uses: neoforged/actions/.github/workflows/publish-prs.yml@main
with:
artifact_base_path: net/neoforged/jst/
secrets:
PR_PUBLISHING_GH_APP_ID: ${{ secrets.PR_PUBLISHING_GH_APP_ID }}
PR_PUBLISHING_GH_APP_KEY: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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:
push:
branches: [ "main" ]

permissions:
contents: read
statuses: write

jobs:
release:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 17
pre_gradle_tasks: test
gradle_tasks: publish
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_SUBKEY: ${{ secrets.GPG_SUBKEY }}
GPG_SUBKEY_ID: ${{ secrets.GPG_SUBKEY_ID }}
GPG_SUBKEY_PASSWORD: ${{ secrets.GPG_SUBKEY_PASSWORD }}

23 changes: 0 additions & 23 deletions .github/workflows/test-report.yml

This file was deleted.

14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
plugins {
id 'java'
id 'maven-publish'
id 'net.neoforged.gradleutils'
}

group = "net.neoforged"
group = "net.neoforged.jst"
gradleutils.version {
branches.suffixBranch()
}
project.version = gradleutils.version

println "Version ${project.version}"

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

subprojects {
group = rootProject.group
version = rootProject.version
Expand Down
2 changes: 2 additions & 0 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jar {
}
}

rootProject.gradleutils.setupSigning(project: project, signAllPublications: true)

dependencies {
implementation project(":api")
implementation "info.picocli:picocli:$picocli_version"
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginManagement {
}
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.8'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.10'
}
}

Expand Down

0 comments on commit 627f2da

Please sign in to comment.