[MC1.18.2] [Forge] v1.0.15 #23
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: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Extract Version from Tag | |
id: split_tag | |
run: | | |
tag=${{ github.event.release.tag_name }} | |
parts=(${tag//\// }) | |
echo "mc_version=${parts[0]}" >> $GITHUB_OUTPUT | |
echo "mod_version=${parts[1]}" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ubuntu-latest-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: ubuntu-latest-gradle- | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew -Psemver='${{ steps.split_tag.outputs.mod_version }}' build | |
env: | |
GPR_USER: ${{ secrets.GPR_USER }} | |
GPR_KEY: ${{ secrets.GPR_KEY }} | |
- name: Add Artifacts to Github Release | |
uses: alexellis/upload-assets@0.4.1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
asset_paths: '["./build/libs/*.jar"]' | |
- name: Publish to Curseforge and Minotaur (Forge) | |
uses: Kir-Antipov/mc-publish@v3 | |
with: | |
name: ${{ github.event.repository.name }}-MC${{ steps.split_tag.outputs.mc_version }}-${{ steps.split_tag.outputs.mod_version }} | |
version: MC${{ steps.split_tag.outputs.mc_version }}-forge-${{ steps.split_tag.outputs.mod_version }} | |
java: Java 17 | |
files: build/libs/*.jar | |
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} |