-
Notifications
You must be signed in to change notification settings - Fork 41
74 lines (63 loc) · 2.05 KB
/
build.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
name: Build
on:
push:
branches:
- main
- development
- release/*
- hotfix/*
- mead/*
pull_request:
types: [ready_for_review, opened, reopened, auto_merge_enabled]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- packCmd: l
os: ubuntu-latest
- packCmd: m
os: macos-latest
- packCmd: w
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/[email protected]
- name: Copy builder config
shell: bash
run: |
timestamp=$(date +%s)
version=$(jq -r .version package.json | awk -F'.' '{print $1"."$2}')
jq --arg version "$version.$timestamp" '.version = $version' package.json > tmp.$$.json && mv tmp.$$.json package.json
jq --arg suffix " Internal" '.productName += $suffix' package.json > tmp.$$.json && mv tmp.$$.json package.json
jq --arg suffix "Internal" '.name += $suffix' package.json > tmp.$$.json && mv tmp.$$.json package.json
sed 's/NineChronicles@workspace/NineChroniclesInternal@workspace/g' yarn.lock > temp.txt
mv temp.txt yarn.lock
- name: Cache electron-gyp
uses: actions/[email protected]
with:
path: ~/.electron-gyp
key: ${{ runner.os }}-electron-gyp
- uses: actions/[email protected]
with:
node-version: 20
cache: 'yarn'
- name: Install
shell: bash
run: yarn install --immutable
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- name: build
shell: bash
run: |
yarn run build-internal && yarn run electron-builder -${{ matrix.packCmd }} --x64 --config ./electron-builder.local.yml --publish never
rm -fR ./dist/*-unpacked
rm -fR ./dist/mac
rm -fR ./dist/mac-arm64
- uses: actions/[email protected]
with:
path: dist
name: Dist-${{ matrix.packCmd }}
retention-days: 3
if-no-files-found: error