chore: Update changelog with fix for #14 #18
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: Release on tag | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
env: | |
JAVA_VERSION: 17 | |
MODRINTH_ID: 'mfDfQvcJ' | |
CURSEFORGE_ID: '544608' | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
- name: Validate Gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '${{env.JAVA_VERSION}}' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build with Gradle | |
run: gradle build | |
- name: Get version numbers from tag | |
id: version | |
run: | | |
# Extract mod and minecraft version from tag | |
mod_version=${GITHUB_REF_NAME#v} | |
mod_version="${mod_version%+*}" | |
minecraft_version=${GITHUB_REF_NAME#*+} | |
echo "mod=$mod_version" >> $GITHUB_OUTPUT | |
echo "minecraft=$minecraft_version" >> $GITHUB_OUTPUT | |
echo "full=$mod_version+$minecraft_version" >> $GITHUB_OUTPUT | |
echo Mod version: $mod_version | |
echo Minecraft version: $minecraft_version | |
- name: Install parse-changelog | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: parse-changelog | |
- name: Parse changelog | |
id: changelog | |
continue-on-error: true | |
run: | | |
# Extract the changelog entry for this release | |
mkdir -p output | |
changelog=output/changelog.md | |
parse-changelog CHANGELOG.md ${{ steps.version.outputs.full }} > $changelog || true | |
if [[ ! -s $changelog ]]; then | |
# No changelog for specific version (mod+minecraft), try just mod version | |
parse-changelog CHANGELOG.md ${{ steps.version.outputs.mod }} > $changelog || true | |
fi | |
if [[ ! -s $changelog ]]; then | |
echo "No changelog available" > $changelog | |
fi | |
echo Extracted changelog for this release: | |
cat $changelog | |
echo "file=$changelog" >> $GITHUB_OUTPUT | |
- name: Publish release | |
id: publish | |
uses: Kir-Antipov/[email protected] | |
with: | |
modrinth-id: ${{ env.MODRINTH_ID }} | |
curseforge-id: ${{ env.CURSEFORGE_ID }} | |
github-token: ${{ secrets.MY_GITHUB_TOKEN }} | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
name: Mod Settings ${{ steps.version.outputs.mod }} (${{ steps.version.outputs.minecraft }}) | |
version: ${{ steps.version.outputs.full }} | |
version-type: release | |
changelog-file: ${{ steps.changelog.outputs.file }} | |
dependencies: | | |
fabric-api(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github) | |
- name: Show results | |
run: | | |
# Show results from mc-publish | |
echo Successfully published Mod Settings ${{ steps.version.outputs.full }} | |
echo Modrinth release ${{ steps.publish.outputs.modrinth-version }}: ${{ steps.publish.outputs.modrinth-url }} | |
echo CurseForge release ${{ steps.publish.outputs.curseforge-version }}: ${{ steps.publish.outputs.curseforge-url }} | |
echo GitHub release ${{ steps.publish.outputs.github-tag }}: ${{ steps.publish.outputs.github-url }} |