Publish #19
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: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
publishedVersions: | |
required: false | |
description: Published Minecraft versions | |
type: string | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Run Build | |
run: ./gradlew chiseledBuild | |
- name: Run Tests | |
run: ./gradlew chiseledTest | |
- name: Fetch changelog | |
run: | | |
{ | |
echo "CHANGELOG<<EOF" | |
tr -d '\r' < CHANGELOG.md | awk -vver="${GITHUB_REF_NAME#v}" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p' | |
echo "EOF" | |
} >> $GITHUB_ENV | |
- run: ./gradlew chiseledPublish | |
env: | |
CHANGELOG: ${{ env.CHANGELOG }} | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | |
CHISELED_VERSIONS: ${{ inputs.publishedVersions }} | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: ${{ env.CHANGELOG }} | |
files: versions/*/build/libs/*.jar |