Skip to content

Commit 6898016

Browse files
Update build.yml
1 parent 1bc069a commit 6898016

File tree

1 file changed

+20
-31
lines changed

1 file changed

+20
-31
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,42 @@ 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: Setup Windows
15+
if: matrix.os == 'windows-latest'
16+
uses: ilammy/msvc-dev-cmd@v1
17+
- name: Setup NASM for Windows
18+
if: matrix.os == 'windows-latest'
19+
uses: ilammy/[email protected]
20+
- name: Setup Node.js for Unix
21+
if: matrix.os != 'windows-latest'
22+
uses: actions/setup-node@v4
3723
with:
3824
node-version: 20
39-
- name: Update binaries
25+
- name: Install Unix dependencies
26+
if: matrix.os != 'windows-latest'
4027
run: |
4128
uname -a
4229
sudo apt update || true
4330
brew install go || true
4431
sudo apt install -y g++-aarch64-linux-gnu || true
32+
- name: Update binaries
33+
run: |
4534
git clone --recursive https://github.com/uNetworking/uWebSockets.js.git
4635
cd uWebSockets.js
47-
make
36+
${{ matrix.os == 'windows-latest' && 'nmake' || 'make' }}
4837
git fetch origin binaries:binaries
4938
git checkout binaries
50-
cp dist/*.node .
51-
cp dist/*.js .
39+
${{ matrix.os == 'windows-latest' && 'xcopy /Y dist\\*.node .' || 'cp dist/*.node .' }}
40+
${{ matrix.os != 'windows-latest' && 'cp dist/*.js .' || '' }}
41+
${{ matrix.os != 'windows-latest' && 'git rev-parse master > source_commit' || '' }}
42+
${{ matrix.os != 'windows-latest' && 'git checkout master docs/index.d.ts && mv docs/index.d.ts .' || '' }}
5243
git status
53-
git rev-parse master > source_commit
54-
git checkout master docs/index.d.ts && mv docs/index.d.ts .
5544
git config --global user.email "[email protected]"
5645
git config --global user.name "Alex Hultman"
5746
git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} binaries" || true

0 commit comments

Comments
 (0)