-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (92 loc) · 2.8 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- "v*"
jobs:
prepare:
name: Prepare job
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
check-latest: true
- name: Install dependencies
run: npm ci
- name: Pre-build
run: npm run build -- --pre-build
- uses: actions/upload-artifact@v4
name: Upload artifact
with:
name: pre-build
path: ./build
build_multi_linux:
name: Build Linux ${{ matrix.arch }}
needs: prepare
runs-on: ${{ matrix.distro }}
strategy:
matrix:
distro: [ubuntu-22.04]
arch: [aarch64, x64]
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
github-token: ${{ github.token }}
name: pre-build
path: ./build
- uses: uraimo/run-on-arch-action@v2
name: Build artifact ${{ matrix.arch }}
if: matrix.arch == 'aarch64'
id: build
with:
arch: ${{ matrix.arch }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt update && apt upgrade -y && apt install -y curl unzip ca-certificates curl gnupg
curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt update && apt install -y nodejs
run: |
npm i
npm run build -- --install --compress --obfuscate --pkg --clean
- name: Node.js ${{ matrix.node-version }}
if: matrix.arch == 'x64'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
check-latest: true
- name: Rebuild Modules
if: matrix.arch == 'x64'
run: rm -rf node_modules && npm ci
- name: Build Release
if: matrix.arch == 'x64'
run: npm run build -- --install --compress --obfuscate --pkg --clean
- uses: actions/upload-artifact@v4
name: Upload artifact
with:
name: build-ubuntu-latest-${{ matrix.arch }}
path: ./build
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true