2024-11-04 21:36:53 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags: ["*"]
|
|
|
|
jobs:
|
2024-11-04 22:22:33 +01:00
|
|
|
release:
|
2024-11-04 21:36:53 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Java
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
java-version: '21'
|
|
|
|
distribution: 'temurin'
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ hashFiles('**/build.gradle', '**/gradle-wrapper.properties', '**/gradle.properties') }}
|
|
|
|
- name: Grab Changelog from Commit Message Body
|
|
|
|
run: |
|
|
|
|
changelog=$(echo -e "$MESSAGE" | sed -n '/^$/,$p' | sed '1d')
|
2024-11-04 22:28:48 +01:00
|
|
|
echo -e "$changelog"
|
|
|
|
{
|
|
|
|
echo 'CHANGELOG<<EOF'
|
|
|
|
echo -e "$changelog"
|
|
|
|
echo EOF
|
|
|
|
} >> "$GITHUB_ENV"
|
2024-11-04 21:36:53 +01:00
|
|
|
env:
|
|
|
|
MESSAGE: ${{ github.event.head_commit.message }}
|
|
|
|
- name: Release
|
|
|
|
run: |
|
|
|
|
chmod +x ./gradlew
|
|
|
|
./gradlew publishMods --no-daemon
|
2024-11-04 22:35:04 +01:00
|
|
|
env:
|
|
|
|
MR_TOKEN: ${{ secrets.MR_TOKEN }}
|
|
|
|
CF_TOKEN: ${{ secrets.CF_TOKEN }}
|