|
5 | 5 | branches: [ master ] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build-windows: |
9 | | - runs-on: windows-latest |
10 | | - steps: |
11 | | - - uses: ilammy/msvc-dev-cmd@v1 |
12 | | - |
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: |
31 | 9 | runs-on: ${{ matrix.os }} |
32 | 10 | strategy: |
33 | 11 | 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] |
35 | 13 | steps: |
36 | | - - uses: actions/setup-node@v4 |
| 14 | + - name: Set up environment |
| 15 | + uses: actions/setup-node@v4 |
37 | 16 | with: |
38 | 17 | 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 | + |
| 24 | + - name: Install Unix dependencies |
| 25 | + if: matrix.os != 'windows-latest' |
40 | 26 | run: | |
41 | 27 | uname -a |
42 | 28 | sudo apt update || true |
43 | 29 | brew install go || true |
44 | 30 | sudo apt install -y g++-aarch64-linux-gnu || true |
| 31 | + - name: Build and update binaries |
| 32 | + shell: bash |
| 33 | + run: | |
45 | 34 | git clone --recursive https://github.com/uNetworking/uWebSockets.js.git |
46 | 35 | 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 |
48 | 44 | git fetch origin binaries:binaries |
49 | 45 | git checkout binaries |
50 | | - cp dist/*.node . |
51 | | - cp dist/*.js . |
52 | 46 | git status |
53 | | - git rev-parse master > source_commit |
54 | | - git checkout master docs/index.d.ts && mv docs/index.d.ts . |
55 | 47 | git config --global user.email "[email protected]" |
56 | 48 | git config --global user.name "Alex Hultman" |
57 | 49 | git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} binaries" || true |
|
0 commit comments