-
-
Notifications
You must be signed in to change notification settings - Fork 9
131 lines (118 loc) · 3.76 KB
/
package.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
name: Packaging
on:
workflow_dispatch:
push:
branches:
- package
tags:
- '*'
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-13
- ubuntu-22.04
- windows-2022
host:
- x64
target:
- x64
node:
- 18
include:
- os: macos-14
node: 18
host: arm64
target: arm64
- os: windows-2022
node: 18
host: x64
target: x86
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- name: Set up bash association
if: startsWith(matrix.os, 'windows')
run: |
ls
ls "c:\\"
ls "c:\\Program Files"
ls "c:\\Program Files/Git"
ls "c:\\Program Files/Git/bin"
cmd /c assoc .sh=bashscript
cmd /c ftype bashscript="%ProgramFiles%\Git\bin\bash.exe" "%1"
cmd /c ftype
- uses: actions/checkout@v4
with:
submodules: true
- name: Submodule cleanup fix # See https://github.com/actions/checkout/issues/358
run: |
git submodule foreach --recursive git clean -ffdx
git submodule foreach --recursive git reset --hard
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
node_modules
core/node_modules
key: ${{ matrix.os }}-${{ matrix.target }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.target }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --network-timeout 300000
- name: Fix Windows x86 sqlite3 binding
if: steps.yarn-cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows') && matrix.target == 'x86'
run: yarn upgrade sqlite3
# Prebuilt binding is for x64. We must build from source for x86 target.
# See:
# https://stackoverflow.com/questions/72553650/how-to-get-node-sqlite3-working-on-mac-m1
# https://yarnpkg.com/lang/en/docs/envvars/#toc-npm-config
env:
npm_config_build_from_source: true
npm_config_target_arch: ia32
npm_config_fallback_to_build: true
- name: Hooks and crooks
run: yarn run setup
env:
RUN_OS: ${{ matrix.os }}
RUN_ARCH: ${{ matrix.target }}
- name: Build
run: yarn run build
- name: Test
run: yarn run test
- name: Package
# github endpoints hang up quite a bit, add one retry.
run: yarn run electron:ci || yarn run electron:ci
env:
TARGET_ARCH: ${{ matrix.target }}
GITHUB_TOKEN: ${{ github.token }}
DEBUG: electron-builder
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.CSC_LINK }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.host }}-${{ matrix.target }}
path: |
dist/grist-desktop-*.exe
dist/grist-desktop-*.AppImage
dist/grist-desktop-*.dmg
if-no-files-found: "error"