Skip to content

Commit

Permalink
Merge branch 'forge-dev' into forge-release/1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
opekope2 committed Dec 1, 2024
2 parents fb24497 + 865d4ad commit 4f55309
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions .github/workflows/publish-release.yml
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:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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]"
Expand Down

0 comments on commit 4f55309

Please sign in to comment.