-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (151 loc) · 4.96 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
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
179
180
181
182
183
184
185
186
name: Build Node.JS
on:
workflow_dispatch:
inputs:
version:
description: "The version to checkout and build to"
required: True
default: "14.17.5"
jobs:
build-mac-release:
name: Build the release on MacOS
runs-on: macos-12
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install ninja on macOS
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install ninja
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Release
- name: Archive
run: |
zipname=$(python -m nodejs.archive Release)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
build-linux-release:
name: Build the release on Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install ninja on Ubuntu
run: sudo apt-get install -y ninja-build
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Release
- name: Archive
run: |
zipname=$(python -m nodejs.archive Release)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
build-windows-release:
name: Build the release on Windows
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Update CA
run: pip install python-certifi-win32
- name: Install nasm on Windows
run: choco install -y nasm
- name: Install GNU patch on Windows
run: choco install -y patch
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Release
- name: Archive
run: |
zipname=$(python -m nodejs.archive Release)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
build-windows-debug:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Update CA
run: pip install python-certifi-win32
- name: Install nasm on Windows
run: choco install -y nasm
- name: Install GNU patch on Windows
run: choco install -y patch
- name: Download node.js source code
run: python -m nodejs.download ${{ github.event.inputs.version }}
- name: Build the libraries
run: python -m nodejs.build Debug
- name: Archive
run: |
zipname=$(python -m nodejs.archive Debug)
echo "::set-output name=zipname::$zipname"
shell: bash
id: archive
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.archive.outputs.zipname }}
path: ${{ steps.archive.outputs.zipname }}
release:
needs:
- build-windows-release
- build-windows-debug
- build-linux-release
- build-mac-release
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Prepare zips
run: |
mkdir zips
mv ./*/*.zip ./zips
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nodejs-${{ github.event.inputs.version }}
release_name: nodejs-${{ github.event.inputs.version }}
- name: Upload release assets
uses: csexton/release-asset-action@v2
with:
pattern: "zips/*.zip"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ steps.create_release.outputs.upload_url }}