fix: include modrinth version #3
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
# This workflow will export the modpack and then upload it to Modrinth | |
name: Publish Modpack | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
# This just needs to run packwiz modrinth export | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download packwiz | |
run: | | |
wget -O packwiz.zip https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip | |
unzip packwiz.zip | |
chmod +x packwiz | |
- name: Export modpack | |
run: ./packwiz modrinth export | |
# Now we need to parse our pack.toml file to get some information | |
- name: Parse pack.toml version | |
uses: SebRollen/toml-action@v1.2.0 | |
id: pack_version | |
with: | |
file: pack.toml | |
field: version | |
- name: Parse pack.toml minecraft version | |
uses: SebRollen/toml-action@v1.2.0 | |
id: pack_minecraft | |
with: | |
file: pack.toml | |
field: versions.minecraft | |
- name: Publish to Modrinth | |
uses: Kir-Antipov/mc-publish@v3.3 | |
# Only publish if we're on the main branch | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && (!contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]')) | |
with: | |
modrinth-id: sQ1MQcd2 | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: true | |
modrinth-unfeature-mode: subset | |
modrinth-version: ${{ steps.pack_version.outputs.value }} | |
modrinth-version-type: release | |
# The files will be 'Kami Chan Optimized-w.x.y.z.mrpack' so just use that | |
files: '*.mrpack' | |
loaders: | | |
fabric | |
# For the name, it's always formatted as '[MC Version] - [Modpack Version]' | |
name: '${{ steps.pack_minecraft.outputs.value }} - ${{ steps.pack_version.outputs.value }}' | |
game-versions: | | |
${{ steps.pack_minecraft.outputs.value }} |