Skip to content

Publish

Publish #34

Workflow file for this run

name: Publish
on:
push:
tags: [ "v*" ]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Parse changelog
run: |
content="$(awk -v version="$GITHUB_REF_NAME" '/^## /{ if (p) { exit }; if ($2 == version) { p = 1; next } } p && NF' CHANGELOG.md)"
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$content" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- uses: Wandalen/wretry.action@master
name: publish
with:
command: ./gradlew chiseledPublish
env:
CHANGELOG: ${{ env.CHANGELOG }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
body: ${{ env.CHANGELOG }}
files: versions/*/build/libs/*.jar