Fix CI #44
Workflow file for this run
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
name: Publish AvM Staff Mod | |
on: | |
push: | |
tags: | |
- forge/* | |
jobs: | |
build: | |
name: Build AvM Staff Mod | |
uses: ./.github/workflows/build.yml | |
with: | |
build-project: true | |
build-docs: true | |
upload-output: true | |
fast: true | |
publish: | |
name: Publish AvM Staff Mod | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Read java version | |
id: read-java-version | |
uses: SebRollen/[email protected] | |
with: | |
file: gradle/libs.versions.toml | |
field: versions.java | |
- 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: format('forge/{0}', 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: 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 }} | |
modrinth-featured: false | |
curseforge-id: ${{ vars.CURSEFORGE_ID }} | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
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.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: AvM Staff Mod ${{ env.mod-version }} | |
files: | | |
dist/forge/!(*-@(dev|sources|javadoc)).jar | |
dist/forge/*-@(dev|sources|javadoc).jar | |
changelog-file: CHANGELOG.g.md | |
- name: Delete build output | |
uses: geekyeggo/[email protected] | |
with: | |
name: | | |
forge-jars | |
useGlob: false | |
failOnError: false | |
push-docs: | |
name: Push documentation | |
runs-on: ubuntu-latest | |
needs: build | |
env: | |
VERSION: ${{ github.ref_name }} | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
ref: docs | |
- name: Configure git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "github-actions[bot]" | |
- name: Download Kotlin documentation | |
uses: actions/[email protected] | |
with: | |
name: kdoc | |
path: docs/kdoc/${{ github.ref_name }} | |
- name: Download Java documentation | |
uses: actions/[email protected] | |
with: | |
name: javadoc | |
path: docs/javadoc/${{ github.ref_name }} | |
- name: Update latest documentation folder (Kotlin) | |
run: | | |
cd docs/kdoc | |
unlink latest | |
ln -s $VERSION latest | |
- name: Update latest documentation folder (Java) | |
run: | | |
cd docs/javadoc | |
unlink latest | |
ln -s $VERSION latest | |
- name: Update links | |
run: | | |
sed -i "s|#CI_KDOC_PLACEHOLDER|#CI_KDOC_PLACEHOLDER\n - $VERSION: kdoc/$VERSION|g" mkdocs.yml | |
sed -i "s|#CI_JAVADOC_PLACEHOLDER|#CI_JAVADOC_PLACEHOLDER\n - $VERSION: javadoc/$VERSION|g" mkdocs.yml | |
- name: Commit documentation | |
run: | | |
git add docs | |
git commit -a -m "Add documentation for $VERSION" | |
- name: Push documentation | |
uses: ad-m/[email protected] | |
with: | |
branch: docs | |
- name: Delete documentation artifacts | |
uses: geekyeggo/[email protected] | |
with: | |
name: | | |
kdoc | |
javadoc | |
useGlob: false | |
failOnError: false | |
publish-docs: | |
name: Publish documentation | |
runs-on: ubuntu-latest | |
needs: push-docs | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
ref: docs | |
- name: Configure git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "github-actions[bot]" | |
- name: Publish documentation | |
uses: mhausenblas/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
REQUIREMENTS: requirements.txt |