-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (49 loc) · 1.89 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 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
# 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 }}