Skip to content

Commit cf5d8ba

Browse files
Update build workflow for multi-OS support
Refactor GitHub Actions workflow to support multiple OS builds and streamline binary updates.
1 parent f07b1fa commit cf5d8ba

File tree

1 file changed

+23
-31
lines changed

1 file changed

+23
-31
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,45 @@ on:
55
branches: [ master ]
66

77
jobs:
8-
build-windows:
9-
runs-on: windows-latest
10-
steps:
11-
- uses: ilammy/msvc-dev-cmd@v1
12-
- uses: ilammy/[email protected]
13-
- name: Update binaries
14-
run: |
15-
$ErrorActionPreference = 'SilentlyContinue'
16-
git clone --recursive https://github.com/uNetworking/uWebSockets.js.git
17-
cd uWebSockets.js
18-
nmake
19-
git fetch origin binaries:binaries
20-
git checkout binaries
21-
xcopy /Y dist\*.node .
22-
git status
23-
git config --global user.email "[email protected]"
24-
git config --global user.name "Alex Hultman"
25-
git commit -a -m "[GitHub Actions] Updated windows-latest binaries"
26-
git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries
27-
git checkout master -- tests/smoke.js
28-
npm install ws
29-
node tests/smoke.js
30-
build-unix:
8+
build:
319
runs-on: ${{ matrix.os }}
3210
strategy:
3311
matrix:
34-
os: [macos-15, ubuntu-24.04, ubuntu-24.04-arm]
12+
os: [windows-latest, macos-15, ubuntu-24.04, ubuntu-24.04-arm]
3513
steps:
36-
- uses: actions/setup-node@v4
14+
- name: Set up environment
15+
uses: actions/setup-node@v4
3716
with:
3817
node-version: 20
39-
- name: Update binaries
18+
- name: Install Windows tools
19+
if: matrix.os == 'windows-latest'
20+
uses: ilammy/msvc-dev-cmd@v1
21+
- name: Install NASM for Windows
22+
if: matrix.os == 'windows-latest'
23+
uses: ilammy/[email protected]
24+
- name: Install Unix dependencies
25+
if: matrix.os != 'windows-latest'
4026
run: |
4127
uname -a
4228
sudo apt update || true
4329
brew install go || true
4430
sudo apt install -y g++-aarch64-linux-gnu || true
31+
- name: Build and update binaries
32+
shell: bash
33+
run: |
4534
git clone --recursive https://github.com/uNetworking/uWebSockets.js.git
4635
cd uWebSockets.js
47-
make
36+
if [ "${{ matrix.os }}" == "windows-latest" ]; then
37+
nmake
38+
else
39+
make
40+
fi
41+
cp dist/*.node . || true
42+
cp dist/*.js . || true
43+
git checkout master docs/index.d.ts && mv docs/index.d.ts . || true
4844
git fetch origin binaries:binaries
4945
git checkout binaries
50-
cp dist/*.node .
51-
cp dist/*.js .
5246
git status
53-
git rev-parse master > source_commit
54-
git checkout master docs/index.d.ts && mv docs/index.d.ts .
5547
git config --global user.email "[email protected]"
5648
git config --global user.name "Alex Hultman"
5749
git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} binaries" || true

0 commit comments

Comments
 (0)