Skip to content

fix mods uploading #314

fix mods uploading

fix mods uploading #314

Workflow file for this run

# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build
on:
push:
pull_request:
release:
types: [created]
jobs:
build:
strategy:
matrix:
include:
- java: 21
branch: main
minecraft_version: "1.21.11"
fabric_version: "0.131.0+1.21.11"
- java: 21
branch: "1.21.10"
minecraft_version: "1.21.10"
fabric_version: "0.131.0+1.21.10"
runs-on: ubuntu-22.04
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
ref: ${{ startsWith(github.ref, 'refs/tags/') && matrix.branch || github.ref }}
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: rename jar file
run: |
cd build/libs
VERSION=$(grep "mod_version=" ../../gradle.properties | cut -d'=' -f2)
ORIGINAL=$(ls SkyCofl-*.jar | grep -v sources | grep -v javadoc | grep -v dev | head -n 1)
RENAMED="SkyCofl-${VERSION}-Fabric-${{ matrix.minecraft_version }}.jar"
mv "$ORIGINAL" "$RENAMED"
- name: capture build artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts-${{ matrix.minecraft_version }}
path: build/libs/
- name: Publish to CurseForge and GitHub Release
uses: Kir-Antipov/mc-publish@v3.3
if: startsWith(github.ref, 'refs/tags/')
with:
curseforge-id: 1286702
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
name: "SkyCofl ${{ github.ref_name }} Fabric ${{ matrix.minecraft_version }}"
version: "${{ github.ref_name }}_Fabric_${{ matrix.minecraft_version }}"
changelog: |
➡️ Bug Fixes and Improvements
${{ github.event.release.body }}
[View on GitHub Releases](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})
loaders: fabric
game-versions: "${{ matrix.minecraft_version }}"
java: "21"
version-type: release
files: |
build/libs/SkyCofl-*-Fabric-*.jar
dependencies: |
fabric@${{ matrix.fabric_version }}(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github)
# The name and version are switched for modrinth
publish-modrinth:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- minecraft_version: "1.21.11"
fabric_version: "0.131.0+1.21.11"
- minecraft_version: "1.21.10"
fabric_version: "0.131.0+1.21.10"
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Artifacts-${{ matrix.minecraft_version }}
path: build/libs/
- name: Publish to Modrinth
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: yso5yMlC
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ""
name: "SkyCofl ${{ github.ref_name }} Fabric ${{ matrix.minecraft_version }}"
version: "${{ github.ref_name }}_Fabric_${{ matrix.minecraft_version }}"
changelog: |
➡️ Bug Fixes and Improvements
${{ github.event.release.body }}
[View on GitHub Releases](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})
loaders: fabric
game-versions: "${{ matrix.minecraft_version }}"
java: "21"
version-type: release
files: |
build/libs/SkyCofl-*-Fabric-${{ matrix.minecraft_version }}.jar
dependencies: |
fabric@${{ matrix.fabric_version }}(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github)