-
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (90 loc) · 2.9 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Publish
on:
workflow_dispatch:
inputs:
name:
description: "Name of the update."
type: string
required: true
releaseChannel:
description: "Release channel to release the mod pack in."
type: choice
options:
- release
- beta
- alpha
default: "release"
jobs:
run:
runs-on: ubuntu-latest
env:
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.19"
- name: Install packwiz
run: go install github.com/packwiz/packwiz@latest
- name: Set up Packwiz cache
uses: actions/cache@v3
with:
path: ~/.cache/packwiz/cache/
key: ${{ runner.os }}-packwiz-store
restore-keys: ${{ runner.os }}-packwiz-store
- name: Set up pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
run_install: false
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --prod
- name: Drop snapshot label
id: version
run: |
sed -i 's/\(version = ".*\)-SNAPSHOT\("\)/\1\2/' src/pack/pack.toml
echo "VERSION=$(cat src/pack/pack.toml | grep "version =" | sed 's/version = "\(.*\)"/\1/')" >> $GITHUB_OUTPUT
- name: Build Modrinth pack
run: pnpm run client:modrinth
- name: Build CurseForge pack
run: |
pnpm run client:curseForge
pnpm run server:curseForge
- name: Get commits since last tag
id: commits
uses: simbo/changes-since-last-release-action@v1
with:
line-prefix: "- "
include-hashes: false
- name: Publish
uses: Kir-Antipov/[email protected]
with:
github-tag: ${{ steps.version.outputs.VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-prerelease: ${{ inputs.releaseChannel != 'release' }}
modrinth-id: scFX3hJJ
modrinth-token: ${{ secrets.MODRINTH_UPLOAD_TOKEN }}
#curseforge-id: 867551
#curseforge-token: ${{ secrets.CURSEFORGE_UPLOAD_TOKEN }}
name: ${{ inputs.name != '' && inputs.name || steps.version.outputs.VERSION }}
version: ${{ steps.version.outputs.VERSION }}
version-type: ${{ inputs.releaseChannel }}
loaders: fabric
game-versions: 1.19.2
github-files: |
build/*.mrpack
build/*.cf.zip
modrinth-files: build/*.mrpack
#curseforge-files: build/*.cf.zip
changelog: ${{ steps.commits.outputs.log }}
fail-mode: warn