forked from octalmage/robotjs
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (53 loc) · 1.86 KB
/
buid.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
on:
workflow_dispatch:
name: build
permissions:
contents: write
jobs:
build:
run-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
host: [x64]
target: [x64]
node: [20]
include:
- os: windows-latest
host: x86
target: x86
node: 20
- os: macos-m1
host: arm64
target: arm64
node: 20
name: os=${{ matrix.os }} host=${{ matrix.host }}, target=${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.host }}
- name: add setuptools for python 3.12
if: matrix.os != 'macos-m1'
run: pip install setuptools
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}
- name: Install dependencies
run: npm install --build-from-source
- name: Build
run: npm run pack
- name: Archive
run: zip -r dist.zip lib/binding/*
- name: upload binaries to github release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dist.zip
asset_name: robotjs_addon-${{ matrix.os }}-${{ matrix.host }}-${{ matrix.target }}.zip
asset_content_type: application/zip