Skip to content

[MC1.20.1] v1.7.11

[MC1.20.1] v1.7.11 #32

Workflow file for this run

name: publish
on:
release:
types: [published]
jobs:
build:
name: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ubuntu-latest-gradle-
- name: Build with Gradle
run: ./gradlew -PmodVersion='${{ steps.split_tag.outputs.mod_version }}' build
- name: Remove extra JARs
run: |
rm fabric/build/libs/*-dev-shadow.jar
rm forge/build/libs/*-dev-shadow.jar
- name: Add Artifacts to Github Release
uses: alexellis/upload-assets@0.4.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./forge/build/libs/*.jar","./fabric/build/libs/*.jar"]'
- name: Publish to Curseforge and Minotaur (Forge)
uses: Kir-Antipov/mc-publish@v3.3
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: forge/build/libs/*.jar
modrinth-token: ${{ secrets.MODRINTH_API_KEY }}
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}
- name: Publish to Curseforge and Minotaur (Fabric)
uses: Kir-Antipov/mc-publish@v3.3
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 }}-fabric-${{ steps.split_tag.outputs.mod_version }}
java: Java 17
files: fabric/build/libs/*.jar
modrinth-token: ${{ secrets.MODRINTH_API_KEY }}
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }}