-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (117 loc) · 4.42 KB
/
Copy pathllrt-native.yml
File metadata and controls
149 lines (117 loc) · 4.42 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: LLRT Native Packages
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- ".github/workflows/llrt-native.yml"
- "packages/llrt/**"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "Taskfile.yml"
push:
branches: [main]
paths:
- ".github/workflows/llrt-native.yml"
- "packages/llrt/**"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "Taskfile.yml"
release:
types: [published]
permissions:
contents: read
id-token: write
jobs:
build-native:
name: Build ${{ matrix.platform_arch_abi }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
platform_arch_abi: darwin-arm64
runner: macos-15
- target: x86_64-apple-darwin
platform_arch_abi: darwin-x64
runner: macos-15-intel
- target: x86_64-unknown-linux-gnu
platform_arch_abi: linux-x64-gnu
runner: ubuntu-24.04
- target: aarch64-unknown-linux-gnu
platform_arch_abi: linux-arm64-gnu
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v4
- run: pnpm install --filter @robinbraemer/llrt...
- run: rustup target add ${{ matrix.target }}
- run: pnpm --filter @robinbraemer/llrt run create:native-packages
- run: pnpm --filter @robinbraemer/llrt run verify:native-artifacts
- run: pnpm --filter @robinbraemer/llrt run prepare:llrt-source
- run: pnpm --filter @robinbraemer/llrt run build:native:target
env:
LLRT_TARGET: ${{ matrix.target }}
- run: pnpm --filter @robinbraemer/llrt run test:native
- run: pnpm --filter @robinbraemer/llrt run collect:native-artifacts
- name: Verify optional native package
working-directory: packages/llrt/npm/${{ matrix.platform_arch_abi }}
run: npm pack --dry-run
- run: pnpm --filter @robinbraemer/llrt run build
- name: Smoke-test packed install on native runner
run: pnpm --filter @robinbraemer/llrt run smoke:packed-install
- uses: actions/upload-artifact@v7
with:
name: llrt-native-${{ matrix.platform_arch_abi }}
path: packages/llrt/npm/${{ matrix.platform_arch_abi }}/llrt_node.${{ matrix.platform_arch_abi }}.node
if-no-files-found: error
package:
name: Package LLRT
runs-on: ubuntu-24.04
needs: build-native
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v4
- run: pnpm install --filter @robinbraemer/llrt...
- run: pnpm --filter @robinbraemer/llrt run create:native-packages
- run: pnpm --filter @robinbraemer/llrt run verify:native-artifacts
- uses: actions/download-artifact@v8
with:
pattern: llrt-native-*
path: artifacts/llrt-native
- name: Place native artifacts into npm package directories
run: |
for artifact_dir in artifacts/llrt-native/llrt-native-*; do
platform_arch_abi="${artifact_dir##*/llrt-native-}"
mkdir -p "packages/llrt/npm/${platform_arch_abi}"
cp "${artifact_dir}/llrt_node.${platform_arch_abi}.node" "packages/llrt/npm/${platform_arch_abi}/"
done
- run: pnpm --filter @robinbraemer/llrt run verify:native-artifacts:strict
- run: pnpm --filter @robinbraemer/llrt run build
- name: Verify main package
working-directory: packages/llrt
run: npm pack --dry-run
- name: Verify optional native packages
run: |
for package_dir in packages/llrt/npm/*; do
(cd "${package_dir}" && npm pack --dry-run)
done
- run: pnpm --filter @robinbraemer/llrt run smoke:packed-install
- name: Prepare native package metadata
if: github.event_name == 'release'
env:
GITHUB_REPOSITORY: ""
run: pnpm --filter @robinbraemer/llrt run prepare:native-publish
- name: Publish optional native packages
if: github.event_name == 'release'
run: |
for package_dir in packages/llrt/npm/*; do
(cd "${package_dir}" && npm publish --access public)
done
- name: Publish main LLRT package
if: github.event_name == 'release'
run: npm publish --access public
working-directory: packages/llrt