v13.0.0 beta release (MC 1.21) #20
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: "Build a release" | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events for the branches listed | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Export release tag as environment variable | |
env: | |
TAG: ${{ github.event.release.tag_name }} | |
run: | | |
echo "TAG=${TAG}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Remove any generated assets/data | |
run: rm -rf ./src/generated | |
- name: Generate assets & data | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: runData --no-daemon | |
- name: Validate assets | |
run: test -d ./src/generated -a -d ./src/generated/resources/.cache | |
- name: Build JAR | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build --no-daemon | |
env: | |
BUILD_NUMBER: ${{ github.run_number }} | |
- name: Set up mod metadata | |
id: mod_meta | |
run: | | |
echo mod_version=$(grep ^mod_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT | |
echo mc_version=$(grep ^minecraft_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT | |
- name: Publish to Modmaven | |
uses: gradle/gradle-build-action@v2 | |
env: | |
MODMAVEN_USER: ${{ secrets.MODMAVEN_USER }} | |
MODMAVEN_PASSWORD: ${{ secrets.MODMAVEN_PASSWORD }} | |
with: | |
arguments: publishMavenPublicationToModmavenRepository --no-daemon | |
- name: Publish to Curseforge/Modrinth | |
uses: gradle/gradle-build-action@v2 | |
env: | |
CHANGELOG: ${{ github.event.release.body }} | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
with: | |
arguments: publishMods --no-daemon |