97 lines
3.1 KiB
YAML
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 "AnarchyMod ${{ 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 }}
|