Update npm-publish.yml #45
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 myfirstaddon package | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-addons: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-13, windows-2019, windows-2022] | |
steps: | |
- uses: actions/checkout@v2 | |
- run: git pull origin main --ff-only | |
- name: Setup Node.js v1 | |
if: matrix.os != 'windows-2022' | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 10 | |
# - name: Install Windows 2015 build tools | |
# if: matrix.os == 'windows-2019' | |
# run: npm i --global windows-build-tools --vs2015 | |
- name: Build for Windows 2019 | |
if: matrix.os == 'windows-2019' | |
shell: powershell | |
run: | | |
npm i -g node-gyp@8 | |
.\scripts\build-windows.ps1 | |
- name: Setup Node.js v4 | |
if: matrix.os == 'windows-2022' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Build for Windows 2022 | |
if: matrix.os == 'windows-2022' | |
shell: powershell | |
run: | | |
npm i -g node-gyp@10 | |
.\scripts\build-windows-arm64.ps1 | |
- name: Build for macOS | |
if: matrix.os == 'macos-13' | |
run: | | |
npm i -g node-gyp@8 | |
./scripts/build-macos.sh | |
- name: 'Upload artifacts' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-${{matrix.os}} | |
path: | | |
./lib/bindings/linux/**/**/*.node | |
./lib/bindings/macos/**/*.node | |
./lib/bindings/windows/**/*.node | |
./lib/bindings/windows/**/*.dll | |
publish-npm: | |
needs: build-addons | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: git pull origin main --ff-only | |
- name: 'Download artifacts' | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./lib/bindings | |
merge-multiple: true | |
- name: 'Upload artifacts' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-os | |
path: | | |
./lib/bindings |