generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul CI processes into smaller, reusable workflows
- Loading branch information
1 parent
a87d3b7
commit 059746e
Showing
9 changed files
with
248 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Data Generation | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
datagen: | ||
name: Data Generators | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Data Generation | ||
run: ./gradlew :neoforge:runData | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Store Built Assets | ||
if: success() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: generated-data | ||
path: neoforge/src/generated/resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Gradle Tests and Nightly (CI) | ||
name: Publish and Announce Nightly Build | ||
|
||
env: | ||
GH_PKG_URL: "https://maven.pkg.github.com/${{ github.repository }}" | ||
|
@@ -25,7 +25,6 @@ jobs: | |
fetch-depth: 150 | ||
fetch-tags: true | ||
submodules: true | ||
|
||
- name: Version | ||
id: version | ||
uses: paulhatch/[email protected] | ||
|
@@ -35,71 +34,21 @@ jobs: | |
search_commit_body: true | ||
|
||
datagen: | ||
name: Data Generators | ||
runs-on: ubuntu-22.04 | ||
needs: [ vars ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Data Generation | ||
run: ./gradlew :neoforge:runData | ||
env: | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Store Built Assets | ||
if: success() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: generated-data | ||
path: neoforge/src/generated/resources | ||
|
||
publish-gh-package: | ||
name: Publish Github Package - Nightly | ||
runs-on: ubuntu-22.04 | ||
needs: [ vars, datagen ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Pull Built Generated Data | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: generated-data | ||
path: neoforge/src/generated/resources | ||
|
||
- name: Publish | ||
run: ./gradlew :neoforge:publish | ||
env: | ||
VERSION: ${{ needs.vars.outputs.version }} | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
needs: [vars] | ||
uses: ./.github/workflows/datagen.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.vars.outputs.version }} | ||
|
||
publish: | ||
needs: [vars, datagen] | ||
uses: ./.github/workflows/publish.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.vars.outputs.version }} | ||
|
||
announce: | ||
name: Discord Announcement | ||
needs: [ publish-gh-package ] | ||
needs: [ publish ] | ||
uses: ./.github/workflows/announce-latest-nightly.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# REQUIRES DATAGEN TO BE CALLED IN A JOB BEFORE THIS!! | ||
|
||
name: Release Variables | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
publish: | ||
name: Publish Code as Github Package - ${{ inputs.version }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Pull Built Generated Data | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: generated-data | ||
path: neoforge/src/generated/resources | ||
|
||
- name: Publish | ||
run: ./gradlew :neoforge:publish | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Creates releases on Curseforge and Github Releases based on v* tags | ||
name: Tagged Version Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
vars: | ||
name: Gather Variables | ||
uses: ./.github/workflows/variables-release.yml | ||
secrets: inherit | ||
|
||
datagen: | ||
name: Build | ||
needs: [vars] | ||
uses: ./.github/workflows/datagen.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.vars.outputs.modVersion }} | ||
|
||
publish: | ||
needs: [vars] | ||
uses: ./.github/workflows/publish.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.vars.outputs.modVersion }} | ||
|
||
release-gh: | ||
name: Make Github Release | ||
runs-on: ubuntu-20.04 | ||
needs: [vars, publish] | ||
steps: | ||
- name: Download Build Results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: libs | ||
path: build-out | ||
|
||
- name: Create GitHub Release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
title: "Release ${{ needs.vars.outputs.modVersion }}" | ||
automatic_release_tag: "${{ needs.vars.outputs.modVersion }}" | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
build/libs/simplehoney-neoforge-${{ needs.vars.outputs.modVersion }}.jar | ||
# build/libs/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}-api.jar | ||
|
||
release-cf: | ||
name: Make Curseforge Release | ||
runs-on: ubuntu-20.04 | ||
needs: [vars, publish] | ||
steps: | ||
- name: Download Build Results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: libs | ||
path: build-out | ||
|
||
- name: Full File | ||
id: filename | ||
run: echo "::set-output name=fullpath::build-out/simplehoney-neoforge-${{ needs.vars.outputs.modVersion }}.jar" | ||
|
||
- name: Create CurseForge Release | ||
uses: itsmeow/curseforge-upload@master | ||
with: | ||
token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
project_id: ${{ secrets.CF_PROJECT_ID }} | ||
game_endpoint: minecraft | ||
file_path: ${{ steps.filename.outputs.fullpath }} | ||
game_versions: java:Java 17,NeoForge | ||
release_type: beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release Variables | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
mcVersion: | ||
description: "Minecraft Version" | ||
value: ${{ jobs.vars.outputs.mcVersion }} | ||
neoVersion: | ||
description: "Neoforge Version" | ||
value: ${{ jobs.vars.outputs.neoVersion }} | ||
modVersion: | ||
description: "Mod Version" | ||
value: ${{ jobs.vars.outputs.modVersion }} | ||
|
||
jobs: | ||
vars: | ||
name: Get Variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
mcVersion: ${{steps.minecraft.outputs.version}} | ||
neoVersion: ${{steps.neoforge.outputs.version}} | ||
modVersion: ${{steps.version.outputs.version}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 150 | ||
fetch-tags: true | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Version | ||
id: version | ||
uses: paulhatch/[email protected] | ||
with: | ||
change_path: "neoforge" | ||
version_format: "${major}.${minor}.${patch}" | ||
search_commit_body: true | ||
|
||
- name: MC Version | ||
id: minecraft | ||
run: ./gradlew mcVersion -q >> "$GITHUB_OUTPUT" | ||
env: | ||
VERSION: ${{ steps.version.outputs.version }} | ||
|
||
- name: NeoForge Version | ||
id: neoforge | ||
run: ./gradlew neoVersion -q >> "$GITHUB_OUTPUT" | ||
env: | ||
VERSION: ${{ steps.version.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
tasks.create("mcVersion") { | ||
doFirst { | ||
val mc = libraries.versions.minecraft.get() | ||
println($"version=$mc") | ||
} | ||
} | ||
|
||
tasks.create("neoVersion") { | ||
doFirst { | ||
val neo = libraries.versions.neoforge.get() | ||
println($"version=$neo") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties. | ||
org.gradle.jvmargs=-Xmx3G | ||
org.gradle.daemon=false | ||
org.gradle.debug=false | ||
org.gradle.debug=false | ||
|
||
## Mod Properties | ||
mod_id=simplehoney |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters