-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CI into reusable workflow files
- Loading branch information
1 parent
37d6416
commit 4941690
Showing
4 changed files
with
153 additions
and
78 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-datagen: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-main/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 }}" | ||
|
@@ -10,6 +10,8 @@ on: | |
- "README.md" | ||
- "LICENSE" | ||
- ".github/**/*" | ||
- "**/*.gradle.kts" | ||
- "**/gradle.properties" | ||
|
||
jobs: | ||
vars: | ||
|
@@ -25,7 +27,6 @@ jobs: | |
fetch-depth: 150 | ||
fetch-tags: true | ||
submodules: true | ||
|
||
- name: Version | ||
id: version | ||
uses: paulhatch/[email protected] | ||
|
@@ -34,85 +35,29 @@ jobs: | |
version_format: "${major}.${minor}.${patch}.${increment}-nightly" | ||
search_commit_body: true | ||
|
||
tests: | ||
name: Gradle Tests | ||
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-datagen: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-main/src/generated/resources | ||
|
||
- name: Game Tests | ||
run: ./gradlew :neoforge-main:runGameTestServer | ||
env: | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
datagen: | ||
needs: [vars] | ||
uses: ./.github/workflows/datagen.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.vars.outputs.version }} | ||
|
||
- name: Upload build failure | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-data | ||
path: run/gametest | ||
|
||
publish-gh-package: | ||
name: Publish Github Package - Nightly | ||
runs-on: ubuntu-22.04 | ||
needs: [ vars, tests ] | ||
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-main/src/generated/resources | ||
|
||
- name: Publish | ||
run: ./gradlew :neoforge-main:publish | ||
env: | ||
VERSION: ${{ needs.vars.outputs.version }} | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
tests: | ||
needs: [datagen] | ||
uses: ./.github/workflows/run-gametests.yml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.vars.outputs.version }} | ||
|
||
publish: | ||
needs: [vars, tests] | ||
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: Publish | ||
|
||
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-main/src/generated/resources | ||
|
||
- name: Publish | ||
run: ./gradlew :neoforge-main: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,47 @@ | ||
name: Run Game Tests | ||
|
||
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: Pull Built Generated Data | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: generated-data | ||
path: neoforge-main/src/generated/resources | ||
|
||
- name: Run Game Tests | ||
run: ./gradlew :neoforge-main:runGameTestServer | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload build failure | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-data | ||
path: run/gametest |