Release #8
  
    
      This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Publish Release | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Validate gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| - name: Prepare gradle | |
| run: ./gradlew printVersion --no-daemon | |
| - name: Extract changelog | |
| id: changelog | |
| run: | | |
| OUTPUT_DELIMITER="$(uuidgen)" | |
| echo "changelog<<$OUTPUT_DELIMITER" >> "$GITHUB_OUTPUT" | |
| # extract tag name and use it to get changelog section | |
| TAG_NAME="v$(./gradlew -q --no-daemon printVersion)" | |
| awk -v tag="${TAG_NAME}" ' | |
| $1 == "!!!!!" && $2 == tag {found=1; next} | |
| $1 == "!!!!!" && found {exit} | |
| found | |
| ' CHANGELOG.md >> "$GITHUB_OUTPUT" | |
| # end output | |
| echo "$OUTPUT_DELIMITER" >> "$GITHUB_OUTPUT" | |
| - name: Publish plugin | |
| env: | |
| GITHUB_API_TOKEN: ${{ github.token }} | |
| MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_PUBLISH_TOKEN }} | |
| CHANGELOG: ${{ steps.changelog.outputs.changelog }} | |
| run: ./gradlew publishMods --no-daemon -PnoDryPublish |