-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (79 loc) · 2.86 KB
/
nodejs.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build, test, and upload prebuilds
on:
push:
pull_request:
jobs:
build-x64:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache vcpkg
uses: actions/cache@v3
env:
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#environment-variables
VCPKG_INSTALLATION_ROOT: C:\vcpkg
cache-name: cache-vcpkg
with:
path: ${{ env.VCPKG_INSTALLATION_ROOT }}
key: ${{ runner.os }}-${{ env.cache-name }}
if: ${{ matrix.os == 'windows-latest' }}
- name: Install linux deps
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Install macos deps
run: sudo -H pip install setuptools
if: ${{ matrix.os == 'macos-latest' }}
- name: Install windows deps
run: vcpkg install curl openssl --triplet=x64-windows-static
if: ${{ matrix.os == 'windows-latest' }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm run fetch-deps
- run: npm run build-transmission
- run: npm i
- run: npm test
- run: npm run prebuild
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: ./prebuilds
build-aarch64:
# The host should always be Linux
runs-on: ubuntu-latest
name: Build on aarch64
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
name: Run commands
with:
arch: aarch64
distro: ubuntu_latest
run: |
# install deps
apt update
apt install -y libcurl4-openssl-dev git cmake build-essential libssl-dev
# Install nodejs
apt install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt update
apt install -y nodejs
# Build
git config --global --add safe.directory '*'
npm run fetch-deps
npm run build-transmission
npm i
npm test
npm run prebuild-arm64
- uses: actions/upload-artifact@v3
with:
name: ubuntu-latest
path: ./prebuilds