This repository has been archived by the owner on Mar 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (114 loc) · 3.36 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
name: build
on:
push:
branches:
- main
- 'renovate/**'
pull_request:
merge_group:
schedule:
- cron: '0 1 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref_name }}
cancel-in-progress: true
env:
HUSKY: 0
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: corepack enable
- run: pnpm install
- run: pnpm prettier
build:
needs:
- lint
# lowest possible glibc version
# TODO: use docker to build?
runs-on: ubuntu-20.04
strategy:
# fail-fast: false
matrix:
arch:
- x86_64
- aarch64
node-version:
- 20
- 18
env:
ARCH: ${{ matrix.arch }}
NODE_VERSION: ${{ matrix.node-version }}
BUILDKIT_PROGRESS: plain
BUILDX_NO_DEFAULT_LOAD: 1
steps:
- name: docker-config
uses: containerbase/internal-tools@dc264f478d5abd1fb9e28e29dc3becb0ad57b5a2 # v3.0.61
with:
command: docker-config
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: false
- name: Init
run: ./bin/init.sh
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies for ${{ matrix.arch }}
if: matrix.arch == 'aarch64'
run: |
sudo apt-get update -qq
sudo apt-get -q install -qq -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Build for Node ${{ matrix.node-version }}
run: ./bin/build.sh
- name: Save artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: binaries-${{ matrix.arch }}-${{ matrix.node-version }}
if-no-files-found: error
path: |
.cache/*.br
build-success:
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 1
if: always()
steps:
- name: Fail for failed or cancelled builds
if: |
needs.build.result == 'failure' ||
needs.build.result == 'cancelled'
run: exit 1
release:
needs: build-success
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: false
- name: Init
run: ./bin/init.sh
- name: Download artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
pattern: binaries-*
path: .cache
merge-multiple: true
- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
if: github.ref_name == 'main'
with:
allowUpdates: true
skipIfReleaseExists: true
body: See https://github.com/uhop/node-re2#release-history for more changes
commit: ${{ github.sha }}
name: ${{ env.VERSION }}
tag: ${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: .cache/*.*