-
Notifications
You must be signed in to change notification settings - Fork 18
84 lines (83 loc) · 2.28 KB
/
build_pr.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
name: Build
on:
workflow_dispatch:
inputs:
target:
description: "Build what"
required: true
default: "build-all"
type: choice
options:
- build-client
- build-server
- build-all
version:
description: "Version"
required: true
default: "DevBuild"
type: string
workflow_call:
inputs:
target:
required: true
default: "build-all"
type: string
version:
required: true
type: string
secrets:
API_TOKEN:
required: true
jobs:
pack_pr:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
name: Pack PR
runs-on: ubuntu-22.04
concurrency:
group: pack_pr-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Setup node and npm
uses: actions/setup-node@v4
with:
node-version: 23
cache: 'npm'
cache-dependency-path: tools/build/package-lock.json
- name: Restore mods cache
uses: actions/cache@v4
with:
# observe if this makes broken builds due to outdated mods (server onl)
path: |
dist/modcache
dist/cache.json
key: ${{ runner.os }}-mods-${{ hashFiles('manifest.json') }}
restore-keys: |
${{ runner.os }}-mods-
- name: Restore modlist cache
uses: actions/cache@v4
with:
path: dist/modlist.html
key: ${{ runner.os }}-modlist-${{ hashFiles('manifest.json') }}
restore-keys: |
${{ runner.os }}-modlist-
- name: Replace manifest version
run:
sed -i s/\"version\":\ \"development\"/\"version\":\ \"${{ inputs.version }}\"/ manifest.json
shell: bash
- name: Pack Modpack
env:
CFCORE_API_TOKEN: ${{ secrets.API_TOKEN }}
run: |
cd tools/build
npm install
node . ${{ inputs.target }}
shell: bash
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-zipzip
path: dist/*.zip
if-no-files-found: error
overwrite: true
compression-level: 0