Skip to content

Bump ASM to 9.6

Bump ASM to 9.6 #24

Workflow file for this run

# This workflow will build the project and publish a release using the changelog
# in the last draft release. The draft is deleted after the task is finished.
# Usage:
# 1. Create a draft release. Set the description and the tag (everything else
# will be ignored)
# 2. Push a tag with the same name
name: Release tagged build
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set up Gradle build
run: ./gradlew setupCIWorkspace
- name: Build with Gradle
run: ./gradlew build
- name: Copy artifacts to a single directory
run: |
mkdir build/tmp/ci -p
mkdir build/tmp/ci-dev -p
mkdir build/tmp/ci-sources -p
cp module-*/build/libs/* build/tmp/ci
mv build/tmp/ci/*-all-*-dev.jar build/tmp/ci-dev
mv build/tmp/ci/*-compat-*-dev.jar build/tmp/ci-dev
rm build/tmp/ci/*-dev.jar
mv build/tmp/ci-dev/* build/tmp/ci
rm build/tmp/ci/*-common-*.jar
mv build/tmp/ci/*-sources.jar build/tmp/ci-sources
- uses: actions/upload-artifact@v3
with:
name: Package
path: build/tmp/ci
- uses: actions/upload-artifact@v3
with:
name: Package-sources
path: build/tmp/ci-sources
- name: Read changelog from last draft release
run: |
gh api "/repos/${GITHUB_REPOSITORY}/releases?per_page=1" \
| jq ".[0]" > /tmp/last-release.json
[ $(cat /tmp/last-release.json | jq '.draft' -r) == true ] || (echo "Error: Last release is not a draft" && false)
DRAFT_TAG=$(cat /tmp/last-release.json | jq '.tag_name' -r)
[ $DRAFT_TAG == $RELEASE_VERSION ] || (echo "Error: Last draft's tag does not match pushed tag" && false)
cat /tmp/last-release.json | jq '.body' -r > /tmp/changelog.md
[ $(cat /tmp/changelog.md | wc -w) -gt 0 ] || (echo "Error: Draft is missing a changelog" && false)
cat /tmp/last-release.json | jq '.id' > /tmp/draft_id.txt
env:
GH_TOKEN: ${{ github.token }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: build/tmp/ci/*.jar
body_path: /tmp/changelog.md
- name: Modrinth and CurseForge release
run: |
cp /tmp/changelog.md publish/changelog.md
(cd publish; ./gradlew publishModrinth --stacktrace) || true
(cd publish; ./gradlew publishCurseforge --stacktrace)
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
- name: Publish to GTNH maven
run: ./gradlew publish
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USER: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Delete last draft release
run: |
gh api -X DELETE "/repos/${GITHUB_REPOSITORY}/releases/$(cat /tmp/draft_id.txt)"
env:
GH_TOKEN: ${{ github.token }}