generated from SmushyTaco/Example-Mod
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'forge-dev' into forge-release/1.21
- Loading branch information
Showing
1 changed file
with
43 additions
and
22 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish Staff Mod | ||
name: Publish AvM Staff Mod | ||
|
||
on: | ||
push: | ||
|
@@ -7,7 +7,7 @@ on: | |
|
||
jobs: | ||
build: | ||
name: Build Staff Mod | ||
name: Build AvM Staff Mod | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
build-project: true | ||
|
@@ -16,40 +16,48 @@ jobs: | |
fast: true | ||
|
||
publish: | ||
name: Publish Staff Mod | ||
name: Publish AvM Staff Mod | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
- name: Download Forge jars | ||
uses: actions/[email protected] | ||
with: | ||
name: forge-jars | ||
path: dist/forge | ||
- name: Fetch release tag | ||
run: git fetch origin $GITHUB_REF:$GITHUB_REF -f | ||
- name: Generate changelog | ||
run: git for-each-ref $GITHUB_REF --format '%(contents)' > CHANGELOG.g.md | ||
- name: Load java version | ||
id: load-java-version | ||
- name: Read java version | ||
id: read-java-version | ||
uses: SebRollen/[email protected] | ||
with: | ||
file: gradle/libs.versions.toml | ||
field: versions.java | ||
- name: Load mod version | ||
id: load-mod-version | ||
- name: Read mod version | ||
id: read-mod-version | ||
uses: SebRollen/[email protected] | ||
with: | ||
file: gradle/libs.versions.toml | ||
field: versions.staff-mod | ||
- name: Read Minecraft version | ||
id: read-minecraft-version | ||
uses: SebRollen/[email protected] | ||
with: | ||
file: gradle/libs.versions.toml | ||
field: versions.minecraft | ||
- name: Ensure git tag and mod version match | ||
if: steps.load-mod-version.outputs.value != github.ref_name | ||
if: steps.read-mod-version.outputs.value != github.ref_name | ||
run: | | ||
echo "git tag '$GITHUB_REF_NAME' doesn't match mod version '${{ steps.load-mod-version.outputs.value }}'" | ||
echo "git tag '$GITHUB_REF_NAME' doesn't match mod version '${{ steps.read-mod-version.outputs.value }}'" | ||
exit 1 | ||
- name: Download Forge jars | ||
uses: actions/[email protected] | ||
with: | ||
name: forge-jars | ||
path: dist/forge | ||
- name: Fetch release tag | ||
run: git fetch origin $GITHUB_REF:$GITHUB_REF -f | ||
- name: Generate changelog | ||
run: git for-each-ref $GITHUB_REF --format '%(contents)' > CHANGELOG.g.md | ||
- name: Publish Forge mod to Modrinth and CurseForge | ||
uses: Kir-Antipov/[email protected] | ||
env: | ||
mod-version: ${{ steps.read-mod-version.outputs.value }}-forge.${{ steps.read-minecraft-version.outputs.value }} | ||
with: | ||
modrinth-id: ${{ vars.MODRINTH_ID }} | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
|
@@ -58,20 +66,22 @@ jobs: | |
curseforge-id: ${{ vars.CURSEFORGE_ID }} | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
name: Staff Mod ${{ github.ref_name }} | ||
version: ${{ github.ref_name }} | ||
name: AvM Staff Mod ${{ env.mod-version }} | ||
version: ${{ env.mod-version }} | ||
files: | | ||
dist/forge/!(*-@(dev|dev-shadow|sources|javadoc)).jar | ||
dist/forge/*-@(dev|dev-shadow|sources|javadoc).jar | ||
changelog-file: CHANGELOG.g.md | ||
game-version-filter: releases | ||
java: ${{ steps.load-java-version.outputs.value }} | ||
java: ${{ steps.read-java-version.outputs.value }} | ||
- name: Publish mods to GitHub | ||
uses: Kir-Antipov/[email protected] | ||
env: | ||
mod-version: ${{ steps.read-mod-version.outputs.value }}-forge.${{ steps.read-minecraft-version.outputs.value }} | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: Staff Mod ${{ github.ref_name }} | ||
name: AvM Staff Mod ${{ env.mod-version }} | ||
files: | | ||
dist/forge/!(*-@(dev|sources|javadoc)).jar | ||
dist/forge/*-@(dev|sources|javadoc).jar | ||
|
@@ -96,6 +106,17 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
ref: docs | ||
- name: Read mod version | ||
id: read-mod-version | ||
uses: SebRollen/[email protected] | ||
with: | ||
file: gradle/libs.versions.toml | ||
field: versions.staff-mod | ||
- name: Ensure git tag and mod version match | ||
if: steps.read-mod-version.outputs.value != github.ref_name | ||
run: | | ||
echo "git tag '$GITHUB_REF_NAME' doesn't match mod version '${{ steps.read-mod-version.outputs.value }}'" | ||
exit 1 | ||
- name: Configure git | ||
run: | | ||
git config user.email "[email protected]" | ||
|