Repository navigation
178 lines (171 loc) · 5.71 KB
/
Copy pathnode-build.yml
File metadata and controls
178 lines (171 loc) · 5.71 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Node Build
on:
workflow_dispatch:
inputs:
node_tag:
description: 'The tag of node to build'
required: true
default: v20.11.0
push:
tags:
- 'node'
permissions: write-all
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
with-intl: [none, small-icu, full-icu]
include:
# linux
- os: ubuntu-latest
with-intl: none
platform: linux
arch: x64
# - os: ubuntu-latest
# with-intl: system-icu
# platform: linux
# arch: x64
- os: ubuntu-latest
with-intl: small-icu
platform: linux
arch: x64
- os: ubuntu-latest
with-intl: full-icu
platform: linux
arch: x64
# macos
- os: macos-latest
with-intl: none
platform: macos
arch: x64
# - os: macos-latest
# with-intl: system-icu
# platform: macos
# arch: x64
- os: macos-latest
with-intl: small-icu
platform: macos
arch: x64
- os: macos-latest
with-intl: full-icu
platform: macos
arch: x64
# windows
- os: windows-latest
with-intl: none
platform: windows
arch: x64
# - os: windows-latest
# with-intl: system-icu
# platform: windows
# arch: x64
- os: windows-latest
with-intl: small-icu
platform: windows
arch: x64
- os: windows-latest
with-intl: full-icu
platform: windows
arch: x64
steps:
- uses: actions/checkout@v3
- name: Checkout node for building
run: |
# when triggered by push, node_tag is empty, so use default tag
tag_name=${{ github.event.inputs.node_tag }}; if [ -z $tag_name ]; then tag_name='v20.11.0'; fi
echo "tag_name=$tag_name" >> "$GITHUB_ENV"
git clone -b $tag_name https://github.com/nodejs/node.git
cd node
git status
git branch
git log -1
- name: Install ubuntu deps
if: startsWith(matrix.os, 'ubuntu')
run: |
ls /usr/bin/gcc*
# sudo update-alternatives --list gcc || true
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
# sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
# sudo update-alternatives --list gcc || true
gcc -v
sudo apt update -y
sudo apt install -y build-essential python3 python3-pip make libicu-dev
- name: Install macos deps
if: startsWith(matrix.os, 'macos')
run: |
brew update
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install icu4c pkg-config make
- name: Install windows deps
if: startsWith(matrix.os, 'windows')
run: |
choco upgrade chocolatey -y
choco install nasm
- name: Initialization for ${{ env.tag_name }} ...
run: |
echo ok!
- name: Release some disk spaces for macos build, remove old xcode versions ...
if: startsWith(matrix.os, 'macos')
run: |
echo "Disk spaces before cleanup"
sudo df -h
sudo du -sh /*
echo "Searching for Xcode versions:"
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1
# https://github.com/actions/runner-images/issues/2840#issuecomment-2334584217
echo "Remove all but the latest Xcode..."
find /Applications/ -name "Xcode*" | sort -r | tail --lines=+2 | xargs rm -rf
echo "Available Xcode versions after removal:"
find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1
echo "Disk spaces after cleanup"
sudo df -h
sudo du -sh /*
- name: Building for linux ...
if: startsWith(matrix.os, 'ubuntu')
run: |
./configure --with-intl=${{ matrix.with-intl }}
make -j$(nproc)
working-directory: node
- name: Building for macos ...
if: startsWith(matrix.os, 'macos')
run: |
# https://github.com/memkind/memkind/issues/33#issuecomment-540614162
echo "macos: sysctl -n hw.physicalcpu: $(sysctl -n hw.physicalcpu)"
echo "macos: sysctl -n hw.logicalcpu: $(sysctl -n hw.logicalcpu)"
echo "macos: getconf _NPROCESSORS_ONLN: $(getconf _NPROCESSORS_ONLN)"
./configure --with-intl=${{ matrix.with-intl }}
make -j$(getconf _NPROCESSORS_ONLN)
working-directory: node
- name: Building for windows ...
if: startsWith(matrix.os, 'windows')
run: |
# if with-intl is none, then use intl-none as build argument
intl=${{ matrix.with-intl }}
if [ "${intl}" == "none" ]; then
intl=intl-none
fi
./vcbuild.bat ${{ matrix.arch }} ltcg ${intl}
working-directory: node
- name: Inspecting ...
run: |
ls -lR out
working-directory: node
- name: Prepare on windows ...
if: matrix.os != 'windows-latest'
run: |
cp node/out/Release/node node-${{ matrix.platform }}-${{ matrix.arch }}-${{ env.tag_name }}-with-intl-${{ matrix.with-intl }}
- name: Prepare on ubuntu ...
if: matrix.os == 'windows-latest'
run: |
cp node/out/Release/node.exe node-${{ matrix.platform }}-${{ matrix.arch }}-${{ env.tag_name }}-with-intl-${{ matrix.with-intl }}.exe
- name: Release
uses: softprops/action-gh-release@v1
with:
files: node-*
tag_name: node
release_name: node