-
Notifications
You must be signed in to change notification settings - Fork 6
95 lines (89 loc) · 3.4 KB
/
Copy pathaudio-capture-prebuilds.yml
File metadata and controls
95 lines (89 loc) · 3.4 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: 'Audio Capture Prebuilds'
# Cross-compiles the @qwen-code/audio-capture native addon (miniaudio + N-API)
# into prebuilds/<platform>-<arch>/*.node for every supported target, then
# bundles them into a single `audio-capture-prebuilds` artifact.
#
# The publish job (in release.yml) should download that artifact into
# packages/audio-capture/prebuilds/ before `npm publish`, e.g.:
#
# - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
# with:
# name: audio-capture-prebuilds
# path: packages/audio-capture/prebuilds
#
# N-API is ABI-stable, so one prebuild per platform/arch works across Node
# versions and `node-gyp-build` selects the right one at require time.
on:
workflow_call:
workflow_dispatch:
permissions:
contents: 'read'
defaults:
run:
working-directory: 'packages/audio-capture'
jobs:
build:
name: 'prebuild ${{ matrix.os }} (${{ matrix.arch }})'
runs-on: '${{ matrix.runner }}'
strategy:
fail-fast: false
matrix:
include:
# arm64 runner; also cross-compiles the x64 slice (see Build step) to
# avoid the scarce macos-13 Intel runner that queues 20+ min (#5642).
- os: 'macos-14'
runner: 'macos-14'
arch: 'arm64'
artifact_suffix: 'arm64+x64'
- os: 'ubuntu-latest'
runner: 'ubuntu-latest'
arch: 'x64'
- os: 'ubuntu-24.04-arm'
runner: 'ubuntu-24.04-arm'
arch: 'arm64'
- os: 'windows-latest'
runner: 'windows-2022'
arch: 'x64'
steps:
- uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6.0.3
- uses: 'actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e' # v6.4.0
with:
node-version: '22'
# Install only this package's deps (skip the node-gyp-build install hook;
# prebuildify does its own compile below).
- name: 'Install build deps'
run: 'npm install --no-workspaces --ignore-scripts --no-audit --no-fund'
- name: 'Build prebuild'
shell: 'bash'
run: |
npm run prebuildify
# Cross-compile the Intel (x64) slice on this arm64 runner instead of
# a separate macos-13 runner (frameworks are universal). See #5642.
if [ "$RUNNER_OS" = 'macOS' ]; then
npm run prebuildify -- --arch x64
fi
- name: 'Upload prebuild'
uses: 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a' # v7.0.1
with:
name: 'prebuilds-${{ matrix.os }}-${{ matrix.artifact_suffix || matrix.arch }}'
path: 'packages/audio-capture/prebuilds/'
if-no-files-found: 'error'
collect:
name: 'collect prebuilds'
needs: 'build'
runs-on: 'ubuntu-latest'
steps:
- name: 'Merge per-platform prebuilds'
uses: 'actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c' # v8.0.1
with:
pattern: 'prebuilds-*'
merge-multiple: true
path: 'packages/audio-capture/prebuilds'
- name: 'List collected prebuilds'
run: 'find prebuilds -type f'
- name: 'Upload combined prebuilds'
uses: 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a' # v7.0.1
with:
name: 'audio-capture-prebuilds'
path: 'packages/audio-capture/prebuilds/'
if-no-files-found: 'error'