Build Windows Binaries #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Windows Binaries | |
on: | |
workflow_dispatch: # Trigger manually from Actions tab | |
push: | |
tags: | |
- "v*" # OR when you push a version tag like `v1.0.0` | |
jobs: | |
build: | |
name: Build ${{ matrix.os }} ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
arch: [x64] # You can add more like arm64 if needed | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- name: Install dependencies and build | |
run: | | |
npm install | |
npm install --global windows-build-tools | |
npm run build | |
- name: Package native binary | |
run: npm run package | |
- name: Upload to GitHub Release | |
env: | |
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Publishing to GitHub Release..." | |
npx node-pre-gyp-github publish --release |