-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (124 loc) · 4.08 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Build CI
on:
push:
tags:
- "**"
env:
GH_ACCESS_TOKEN: ${{secrets.GH_ACCESS_TOKEN}}
NODE_OPTIONS: "--max-old-space-size=8192"
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: sudo apt-get install fakeroot dpkg rpm -y
- run: yarn
- run: yarn lint:check
- run: yarn pretty:check
- run: yarn install-pkgs
- run: yarn build-pkgs
- run: node scripts/prebuild.js
- run: yarn make
- uses: actions/upload-artifact@v3
with:
name: build-linux
path: cysync/out/make/*
retention-days: 1
build-win:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Windows Certificate Config
id: write_file
uses: timheuer/base64-to-file@v1
with:
fileName: 'win-certificate.pfx'
encodedString: ${{ secrets.CERTIFICATE_WINDOWS_PFX }}
- name: Use Node.js ${{ matrix.node-version }}
env:
WINDOWS_PFX_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: yarn
- run: yarn install-pkgs
- run: yarn build-pkgs
- run: node scripts\prebuild.js
- name: create signed build
env:
WINDOWS_PFX_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
run: yarn make
- uses: actions/upload-artifact@v3
with:
name: build-win
path: cysync/out/make/*
retention-days: 1
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Build Macos Arm64 & Intel
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
run: |
# arch -arm64 ./scripts/build-mac.sh
arch -x86_64 ./scripts/build-mac.sh
- uses: actions/upload-artifact@v3
with:
name: build-macos
path: cysync/out/make/*
retention-days: 1
release-build:
runs-on: ubuntu-latest
needs: [build-win, build-linux, build-macos]
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- uses: actions/download-artifact@v3
- run: yarn --ignore-scripts
- run: node scripts/prebuild.js
- run: node scripts/postbuild.js "build-win,build-linux,build-macos"