-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (57 loc) · 1.98 KB
/
build-app.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
name: Build and package application
on:
workflow_dispatch:
branches: [ main ]
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
release:
runs-on: ${{ matrix.os }}
continue-on-error: false
timeout-minutes: 30
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node-version: [16.x]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out Git repository
uses: actions/checkout@v2
# Install Node.js, npm and yarn
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
check-latest: true
cache: yarn
cache-dependency-path: yarn.lock
# Install necessary system dependencies to compile on Linux
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libc6-dev-i386 gcc-multilib g++-multilib
# Module caching
- name: Cache node_modules
uses: actions/cache@v2
id: cacheNodeModules
with:
path: ${{ github.workspace }}\node_modules
key: ${{ runner.os }}-node_modules-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
restore-keys: |
${{ runner.os }}-node_modules-cache-v2-
- name: Cache electron
uses: actions/cache@v2
with:
path: ${{ env.LOCALAPPDATA }}\electron\Cache
key: ${{ runner.os }}-electron-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
- name: Cache electron-builder
uses: actions/cache@v2
with:
path: ${{ env.LOCALAPPDATA }}\electron-builder\cache
key: ${{ runner.os }}-electron-builder-cache-v2-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }}
- name: Run build script
run: yarn build --minify