-
Notifications
You must be signed in to change notification settings - Fork 7
112 lines (106 loc) · 3.22 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
name: Build and lint
on:
push:
branches:
- main
tags-ignore:
- v*
pull_request:
branches:
- main
jobs:
build:
name: Static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.5.1
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.10.x
cache: pnpm
- name: Install
run: pnpm install
- name: Build and lint
run: pnpm run ci
changes:
name: Check changed files
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
config: ${{ steps.filter.outputs.config }}
steps:
- uses: actions/checkout@v3
if: ${{ github.event_name == 'push' }}
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
config:
- package.json
- tsconfig.json
- forge.config.js
- .github/workflows/**
make:
name: Make (${{ matrix.os }} - ${{ matrix.arch }})
if: ${{ needs.changes.outputs.config == 'true' }}
needs: changes
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macOS-13-xlarge, macOS-latest, ubuntu-latest, windows-latest ]
arch: [ x64, arm64 ]
# Publishing artifacts for multiple Windows architectures has
# a bug which can cause the wrong architecture to be downloaded
# for an update, so until that is fixed, only build Windows x64
exclude:
- os: windows-latest
arch: arm64
# Only build arm64 builds on M1 and x86 builds on Intel Mac
- os: macOS-latest
arch: arm64
- os: macOS-13-xlarge
arch: x64
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.5.1
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.10.x
cache: pnpm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install npm packages
run: pnpm install
- name: Generate Windows code signing certificate
if: matrix.os == 'windows-latest'
id: write_file
uses: timheuer/[email protected]
with:
fileName: 'windows-certificate.pfx'
encodedString: ${{ secrets.WINDOWS_CODESIGN_CERTIFICATE }}
- name: Generate MacOS code signing certificate
if: matrix.os == 'macOS-latest' || matrix.os == 'macOS-13-xlarge'
run: ./scripts/add-macos-cert.sh
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
- name: Make
run: pnpm run make --arch=${{ matrix.arch }}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
WINDOWS_CERTIFICATE_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}