[MC1.20.1] v1.7.5 #28
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: | |
- 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/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
asset_paths: '["./forge/build/libs/*.jar","./fabric/build/libs/*.jar","./common/build/libs/*-api.jar"]' | |
- name: Publish to Curseforge and Minotaur (Forge) | |
uses: Kir-Antipov/[email protected] | |
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 | |
common/build/libs/*-api.jar | |
modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | |
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} | |
- name: Publish to Curseforge and Minotaur (Fabric) | |
uses: Kir-Antipov/[email protected] | |
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 | |
common/build/libs/*-api.jar | |
modrinth-token: ${{ secrets.MODRINTH_API_KEY }} | |
curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} |