forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (79 loc) Β· 2.86 KB
/
Copy pathbuild-node-packages.yml
File metadata and controls
91 lines (79 loc) Β· 2.86 KB
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
name: Build node-packages with prebuilt Node
on:
workflow_dispatch:
workflow_run:
workflows: [Build Node]
types:
- completed
pull_request:
paths: .github/workflows/build-node-packages.yml
jobs:
build-packages:
strategy:
matrix:
include:
- platform: linux
arch: x64
runs_on: ubuntu-22.04
- platform: linux
arch: arm64
runs_on: ubuntu-22.04-arm
runs-on: ${{ matrix.runs_on }}
env:
NODE_VERSION: v20.18.3
steps:
- name: Debug Matrix Values
run: |
echo "Matrix platform: ${{ matrix.platform }}"
echo "Matrix arch: ${{ matrix.arch }}"
- name: Download Node archive
run: |
gh release download node-${{ env.NODE_VERSION }}-release \
--repo asana/node \
--pattern "node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Node archive
run: |
mkdir -p node-install
tar -C node-install -xJf node-${{ env.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}-LATEST.tar.xz
echo "$GITHUB_WORKSPACE/node-install/usr/local/bin" >> $GITHUB_PATH
- name: Verify Node Binary Architecture
run: |
echo "Node File:"
file $GITHUB_WORKSPACE/node-install/usr/local/bin/node
echo "Runner architecture:"
uname -m
which node
node -v
node -p "process.arch"
ls
- name: Build node-packages bcrypt
run: |
npm i --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" bcrypt@5.1.0
mkdir bcrypt@5.1.0
mkdir bcrypt@5.1.0/node_modules
- name: Build node-packages cld
run: |
npm i --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" cld@2.9.1
mkdir cld@2.9.1
mkdir cld@2.9.1/node_modules
- name: Build node-packages unix-dgram
run: |
npm i --nodedir="$GITHUB_WORKSPACE/node-install/usr/local" unix-dgram@2.0.6
mkdir unix-dgram@2.0.6
mkdir unix-dgram@2.0.6/node_modules
- name: Tar node-packages
run: |
mv node_modules/bcrypt ./bcrypt@5.1.0/node_modules/bcrypt
mv node_modules/cld ./cld@2.9.1/node_modules/cld
mv node_modules/unix-dgram ./unix-dgram@2.0.6/node_modules/unix-dgram
tar --hard-dereference -cvzf packages_${{matrix.arch}}.tar.gz bcrypt@5.1.0 cld@2.9.1 unix-dgram@2.0.6
- name: Upload archive to release
uses: softprops/action-gh-release@v1
with:
name: node-${{ env.NODE_VERSION }}-LATEST
tag_name: node-${{ env.NODE_VERSION }}-release
files: packages_${{matrix.arch}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}