-
Notifications
You must be signed in to change notification settings - Fork 42
90 lines (77 loc) · 2.59 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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: Sync time on Ubuntu
continue-on-error: true
if: runner.os == 'Linux'
run: |
sudo chronyc -a makestep
- name: Sync time on macOS
continue-on-error: true
if: runner.os == 'macOS'
run: |
UNIX_TIMESTAMP=$(curl -s http://worldtimeapi.org/api/ip | jq '.unixtime')
echo "Unix timestamp is: $UNIX_TIMESTAMP"
sudo systemsetup -setusingnetworktime off
sudo date -r $UNIX_TIMESTAMP
sudo systemsetup -setusingnetworktime on
- 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