-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
172 additions
and
189 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
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,123 @@ | ||
name: "Publish branch" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
mod_loaders: | ||
description: 'List of mod loaders to be published' | ||
required: true | ||
type: string | ||
branch: | ||
description: "Branch to be published" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build ${{ inputs.branch }} | ||
timeout-minutes: 30 | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
fetch-depth: 0 | ||
|
||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: ./.github/scripts/parse-gradle-properties.sh | ||
|
||
- name: "Parse changelog" | ||
run: ./.github/scripts/parse-changelog.sh ${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
|
||
- name: "Create github release" | ||
continue-on-error: true | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
skipIfReleaseExists: true | ||
allowUpdates: true | ||
omitNameDuringUpdate: true | ||
omitBodyDuringUpdate: true | ||
tag: mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
commit: ${{ inputs.branch }} | ||
name: ${{ steps.gradle-properties.outputs.MOD_NAME }} ${{ steps.gradle-properties.outputs.MOD_VERSION }} for Minecraft ${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }} | ||
bodyFile: RELEASE_CHANGELOG.md | ||
|
||
- name: "Set up JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} | ||
distribution: temurin | ||
|
||
- name: "Setup Gradle and run build" | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
generate-job-summary: false | ||
gradle-version: wrapper | ||
arguments: build | ||
|
||
- name: "Upload Built JARs" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: built-jars-${{ inputs.branch }} | ||
if-no-files-found: error | ||
path: | | ||
./**/build/libs/*[0-9].jar | ||
- name: "Generate matrix for the run job" | ||
id: set-matrix | ||
run: ./.github/scripts/generate-publish-matrix.sh "${{ inputs.mod_loaders }}" ${{ vars.CURSEFORGE_FABRIC_PROJECT_ID }} ${{ vars.CURSEFORGE_FORGE_PROJECT_ID }} ${{ vars.MODRINTH_FABRIC_PROJECT_ID }} ${{ vars.MODRINTH_FORGE_PROJECT_ID }} | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
name: Publish ${{ inputs.branch }} ${{ matrix.mod_loader }} | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJson(needs.build.outputs.matrix)}} | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
fetch-depth: 0 | ||
|
||
- name: "Download Built JARs" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: built-jars-${{ inputs.branch }} | ||
|
||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: ./.github/scripts/parse-gradle-properties.sh | ||
|
||
- name: "Parse changelog" | ||
run: ./.github/scripts/parse-changelog.sh ${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
|
||
- name: Publish ${{ matrix.mod_loader }} | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
github-tag: mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
github-commitish: ${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }} | ||
|
||
#curseforge-id: ${{ matrix.curseforge_project_id }} | ||
#curseforge-token: ${{ secrets.CURSEFORGE_RELEASE_TOKEN }} | ||
|
||
#modrinth-id: ${{ matrix.modrinth_project_id }} | ||
#modrinth-token: ${{ secrets.MODRINTH_RELEASE_TOKEN }} | ||
|
||
name: ${{ steps.gradle-properties.outputs.MOD_NAME }} ${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
version: ${{ matrix.mod_loader }}-mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
loaders: ${{ join(matrix.supported_mod_loaders, ' ') }} | ||
game-versions: "${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}\n${{ steps.gradle-properties.outputs.MIN_MINECRAFT_VERSION }}" | ||
changelog-file: RELEASE_CHANGELOG.md | ||
files: | | ||
${{ matrix.mod_loader }}/build/libs/*[0-9].jar |
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 |
---|---|---|
|
@@ -15,116 +15,14 @@ on: | |
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build ${{ matrix.branch }} | ||
timeout-minutes: 15 | ||
publish: | ||
name: "Publish" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
branch: ${{ fromJson(inputs.branches) }} | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
fetch-depth: 0 | ||
|
||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: ./.github/scripts/parse-gradle-properties.sh | ||
|
||
- name: "Parse changelog" | ||
run: ./.github/scripts/parse-changelog.sh ${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
|
||
- name: "Create github release" | ||
continue-on-error: true | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
skipIfReleaseExists: true | ||
allowUpdates: true | ||
omitNameDuringUpdate: true | ||
omitBodyDuringUpdate: true | ||
tag: mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
commit: ${{ matrix.branch }} | ||
name: ${{ steps.gradle-properties.outputs.MOD_NAME }} ${{ steps.gradle-properties.outputs.MOD_VERSION }} for Minecraft ${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }} | ||
bodyFile: RELEASE_CHANGELOG.md | ||
|
||
- name: "Set up JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} | ||
distribution: temurin | ||
|
||
- name: "Setup Gradle and run build" | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
generate-job-summary: false | ||
gradle-version: wrapper | ||
arguments: build | ||
|
||
- name: "Upload Built JARs" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: built-jars | ||
if-no-files-found: error | ||
path: | | ||
./**/build/libs/*[0-9].jar | ||
- name: "Generate matrix for the run job" | ||
id: set-matrix | ||
run: ./.github/scripts/generate-publish-matrix.sh "${{ inputs.mod_loaders }}" ${{ vars.CURSEFORGE_FABRIC_PROJECT_ID }} ${{ vars.CURSEFORGE_FORGE_PROJECT_ID }} ${{ vars.MODRINTH_FABRIC_PROJECT_ID }} ${{ vars.MODRINTH_FORGE_PROJECT_ID }} | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
name: Publish ${{ matrix.mod_loader }} | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{fromJson(needs.build.outputs.matrix)}} | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.minecraft_version }} | ||
fetch-depth: 0 | ||
|
||
- name: "Download Built JARs" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: built-jars | ||
|
||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: ./.github/scripts/parse-gradle-properties.sh | ||
|
||
- name: "Parse changelog" | ||
run: ./.github/scripts/parse-changelog.sh ${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
|
||
- name: Publish ${{ matrix.mod_loader }} | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
github-tag: mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
github-commitish: ${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }} | ||
|
||
#curseforge-id: ${{ matrix.curseforge_project_id }} | ||
#curseforge-token: ${{ secrets.CURSEFORGE_RELEASE_TOKEN }} | ||
|
||
#modrinth-id: ${{ matrix.modrinth_project_id }} | ||
#modrinth-featured: true | ||
#modrinth-token: ${{ secrets.MODRINTH_RELEASE_TOKEN }} | ||
|
||
name: ${{ steps.gradle-properties.outputs.MOD_NAME }} ${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
version: ${{ matrix.mod_loader }}-mc${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}-${{ steps.gradle-properties.outputs.MOD_VERSION }} | ||
loaders: ${{ join(matrix.supported_mod_loaders, ' ') }} | ||
game-versions: "${{ steps.gradle-properties.outputs.MINECRAFT_VERSION }}\n${{ steps.gradle-properties.outputs.MIN_MINECRAFT_VERSION }}" | ||
changelog-file: RELEASE_CHANGELOG.md | ||
files: | | ||
${{ matrix.mod_loader }}/build/libs/*[0-9].jar | ||
uses: ./.github/workflows/publish-branch.yml | ||
with: | ||
branch: ${{ matrix.branch }} | ||
mod_loaders: ${{ inputs.mod_loaders }} | ||
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
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
Oops, something went wrong.