forked from desktop/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (76 loc) · 2.81 KB
/
ci.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
name: CI
on:
push:
branches:
- conveyorize
pull_request:
jobs:
build:
name: ${{ matrix.friendlyName }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
permissions: read-all
strategy:
fail-fast: false
matrix:
node: [16.13.0]
os: [macos-11, windows-2019]
arch: [x64, arm64]
include:
- os: macos-11
friendlyName: macOS
- os: windows-2019
friendlyName: Windows
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
# This step can be removed as soon as official Windows arm64 builds are published:
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342
- name: Get NodeJS node-gyp lib for Windows arm64
if: ${{ matrix.os == 'windows-2019' && matrix.arch == 'arm64' }}
run: .\script\download-nodejs-win-arm64.ps1 ${{ matrix.node }}
- name: Install and build dependencies
run: yarn
env:
npm_config_arch: ${{ matrix.arch }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Validate changelog
run: yarn validate-changelog
- name: Ensure a clean working directory
run: git diff --name-status --exit-code
# This will place a prepared app directory with native files and OS-specific JS in out/
- name: Create app files
run: yarn build:prod
env:
SKIP_ELECTRON_PACKAGER: true
- name: Tarball of the results
if: ${{ matrix.os != 'windows-2019' }}
run: tar czvf build-out-${{ matrix.os }}-${{ matrix.arch }}.tar out
- name: Create artifact from Mac output
if: ${{ matrix.os != 'windows-2019' }}
uses: actions/upload-artifact@v3
with:
name: build-out-${{ matrix.friendlyName }}-${{ matrix.arch }}
path: build-out-${{ matrix.os }}-${{ matrix.arch }}.tar
- name: Create artifact from Windows output
if: ${{ matrix.os == 'windows-2019' }}
uses: actions/upload-artifact@v3
with:
name: build-out-${{ matrix.friendlyName }}-${{ matrix.arch }}
path: out