chore: Update release files #4
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 Workflow | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check tag format | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
if ! [[ $TAG_NAME =~ ^v[0-9]+\.[0-9]+\.[0-9]+-(PATCH|MINOR|MAJOR)-(release|alpha|beta)$ ]]; then | |
echo "Invalid tag format: $TAG_NAME" | |
exit 1 | |
fi | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
- name: Extract tag information | |
id: tag_info | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
TAG_INFO=($(echo $GITHUB_REF | sed 's|refs/tags/||' | tr '-' ' ')) | |
echo "VERSION_TYPE=${TAG_INFO[2]}" >> $GITHUB_ENV | |
echo "CHANGELOG_MESSAGE=${TAG_INFO[@]:2}" >> $GITHUB_ENV | |
echo "CHANGELOG_TYPE=${TAG_INFO[1]}" >> $GITHUB_ENV | |
- name: Run ./gradlew updateInformation | |
run: | | |
./gradlew updateInformation | |
env: | |
VERSION_TYPE: ${{ env.VERSION_TYPE }} | |
CHANGELOG_MESSAGE: ${{ env.CHANGELOG_MESSAGE }} | |
CHANGELOG_TYPE: ${{ env.CHANGELOG_TYPE }} | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: main | |
commit_message: "chore: Update release files" | |
commit_user_name: "Dominik Rathmer" | |
commit_user_email: "[email protected]" | |
- name: Run ./gradlew modrinth | |
run: | | |
./gradlew modrinth | |
env: | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} |