Update build.yml

This commit is contained in:
uNetworkingAB
2025-10-21 07:42:32 +02:00
committed by GitHub
parent d4ac21d907
commit 1bc069af3e

View File

@@ -5,49 +5,55 @@ on:
branches: [ master ]
jobs:
build:
build-windows:
runs-on: windows-latest
steps:
- uses: ilammy/msvc-dev-cmd@v1
- uses: ilammy/setup-nasm@v1.2.1
- name: Update binaries
run: |
$ErrorActionPreference = 'SilentlyContinue'
git clone --recursive https://github.com/uNetworking/uWebSockets.js.git
cd uWebSockets.js
nmake
git fetch origin binaries:binaries
git checkout binaries
xcopy /Y dist\*.node .
git status
git config --global user.email "alexhultman@gmail.com"
git config --global user.name "Alex Hultman"
git commit -a -m "[GitHub Actions] Updated windows-latest binaries"
git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries
git checkout master -- tests/smoke.js
npm install ws
node tests/smoke.js
build-unix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-15, ubuntu-24.04, ubuntu-24.04-arm]
os: [macos-15, ubuntu-24.04, ubuntu-24.04-arm]
steps:
- name: Set up environment
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Windows tools
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Install NASM for Windows
if: matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1.2.1
- name: Install Unix dependencies
if: matrix.os != 'windows-latest'
- name: Update binaries
run: |
uname -a
sudo apt update || true
brew install go || true
- name: Build and update binaries
shell: bash
run: |
sudo apt install -y g++-aarch64-linux-gnu || true
git clone --recursive https://github.com/uNetworking/uWebSockets.js.git
cd uWebSockets.js
if [ "${{ matrix.os }}" == "windows-latest" ]; then
nmake
else
make
fi
make
git fetch origin binaries:binaries
git checkout binaries
cp dist/*.node .
cp dist/*.js .
git checkout master docs/index.d.ts && mv docs/index.d.ts .
git fetch origin binaries:binaries
git add *.node *.js index.d.ts
git stash
git checkout binaries
git status
git rev-parse master > source_commit
git checkout master docs/index.d.ts && mv docs/index.d.ts .
git config --global user.email "alexhultman@gmail.com"
git config --global user.name "Alex Hultman"
git stash apply
git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} binaries" || true
git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries
git checkout master -- tests/smoke.js