Files
AnarchyMod/.github/workflows/release.yml
T
AlexProgrammerDEandClaude Opus 4.6 9834f9a675 feat: revamp release workflow with changelog, snapshot bump, and no v prefix
- Split version setting into reusable set-version.yml workflow
- Release tags/titles no longer use "v" prefix
- Added after-version input to bump back to SNAPSHOT after release
- Generate categorized changelog from conventional commits using
  mikepenz/release-changelog-builder-action

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-27 19:13:28 +01:00

97 lines
3.1 KiB
YAML

name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. 1.1.0)"
required: true
after-version:
description: "Next snapshot version (e.g. 1.2.0-SNAPSHOT)"
required: true
permissions:
contents: write
jobs:
set-release-version:
uses: ./.github/workflows/set-version.yml
with:
version: ${{ inputs.version }}
build:
needs: set-release-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.ref }}
fetch-depth: 0
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v5
- run: ./gradlew build
- name: Generate changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v6
with:
commitMode: true
configurationJson: |
{
"categories": [
{ "title": "## Features", "labels": ["feat", "feature"] },
{ "title": "## Fixes", "labels": ["fix", "bug"] },
{ "title": "## Performance", "labels": ["perf"] },
{ "title": "## Refactor", "labels": ["refactor"] },
{ "title": "## Documentation", "labels": ["docs"] },
{ "title": "## Build", "labels": ["build", "chore", "ci"] },
{ "title": "## Other", "labels": [] }
],
"label_extractor": [
{
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"on_property": "title",
"method": "match",
"target": "$1"
}
],
"template": "#{{CHANGELOG}}",
"pr_template": "- [`#{{SHORT_MERGE_SHA}}`](https://github.com/#{{OWNER}}/#{{REPO}}/commit/#{{MERGE_SHA}}) #{{TITLE}}",
"custom_placeholders": [
{
"name": "SHORT_MERGE_SHA",
"source": "MERGE_SHA",
"transformer": {
"pattern": "^([0-9a-f]{7})[0-9a-f]*$",
"target": "$1"
}
}
]
}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ inputs.version }}" \
--title "${{ inputs.version }}" \
--notes "${{ steps.changelog.outputs.changelog }}" \
mc-1.21.8/build/libs/anarchymod-mc-1.21.8-${{ inputs.version }}.jar \
mc-1.21.9/build/libs/anarchymod-mc-1.21.9-${{ inputs.version }}.jar \
mc-1.21.10/build/libs/anarchymod-mc-1.21.10-${{ inputs.version }}.jar \
mc-1.21.11/build/libs/anarchymod-mc-1.21.11-${{ inputs.version }}.jar
set-after-version:
needs: build
uses: ./.github/workflows/set-version.yml
with:
version: ${{ inputs.after-version }}