Repository navigation
188 lines (156 loc) · 5.4 KB
/
Copy pathnode-addon-system-release.yml
File metadata and controls
188 lines (156 loc) · 5.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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Build and publish the @deepseek-ai/node-addon-system package family from the
# harness source of record. Rehearsal and publication consume the same packed
# tarballs; each native binary is built on its matching architecture.
name: Node Addon System Release
on:
workflow_dispatch:
inputs:
publish:
description: Publish packed tarballs to npm. Must run from a node-addon-system-v* tag.
required: true
type: boolean
default: false
permissions:
contents: read
concurrency:
# Stable/prerelease dist-tags are shared registry state; serialize release
# runs so two versions cannot race the final tag assignment.
group: ${{ github.workflow }}
cancel-in-progress: false
defaults:
run:
working-directory: native/system
jobs:
matrix:
name: Matrix
runs-on: ubuntu-24.04
outputs:
prebuilds: ${{ steps.matrix.outputs.prebuilds }}
steps:
- uses: actions/checkout@v7.0.1
- id: matrix
run: echo "prebuilds=$(node ./scripts/github-matrix.mjs release-prebuild)" >> "$GITHUB_OUTPUT"
build-prebuilds:
name: ${{ matrix.package }}
needs: matrix
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.prebuilds) }}
steps:
- uses: actions/checkout@v7.0.1
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: package.json
- uses: actions/setup-node@v7.0.0
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --filter @deepseek-ai/node-addon-system-workspace... --frozen-lockfile
- name: Install musl toolchain
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -yq musl-tools
- name: Build native binaries
run: pnpm build:native
- name: Verify binary metadata
run: node ./scripts/verify-launcher-binary.mjs ${{ matrix.dir }}
- name: Verify the built entry and flock
run: |
pnpm build:ts
pnpm build:test-oracle
pnpm test:flock
pnpm test:packaging
- name: Upload prebuild artifact
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ matrix.artifact }}
path: native/system/${{ matrix.dir }}/bin/**
if-no-files-found: error
retention-days: 7
pack:
name: Pack npm tarballs
needs: build-prebuilds
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.1
- uses: pnpm/action-setup@v5.0.0
with:
package_json_file: package.json
- uses: actions/setup-node@v7.0.0
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --filter @deepseek-ai/node-addon-system-workspace... --frozen-lockfile
- name: Build TypeScript
run: pnpm build:ts
- name: Verify release version
run: node ./scripts/verify-release.mjs
env:
RELEASE_PUBLISH: ${{ inputs.publish }}
- name: Download prebuild artifacts
uses: actions/download-artifact@v8.0.1
with:
pattern: prebuild-*
path: native/system/.release/prebuild-artifacts
- name: Assemble and verify prebuilds
run: node ./scripts/assemble-prebuilds.mjs .release/prebuild-artifacts
- name: Verify release payload
run: node ./scripts/verify-release.mjs --prebuilds
env:
RELEASE_PUBLISH: ${{ inputs.publish }}
- name: Pack release tarballs
run: node ./scripts/pack-release.mjs dist/npm
- name: Verify packed install
run: node ./scripts/verify-packed-install.mjs dist/npm
env:
NALR_REQUIRE_LANDLOCK: 1
- name: Upload npm tarballs
uses: actions/upload-artifact@v7.0.1
with:
name: npm-tarballs
path: native/system/dist/npm/*
if-no-files-found: error
retention-days: 7
publish:
name: Publish to npm
if: inputs.publish
needs: pack
runs-on: ubuntu-24.04
environment: npm-publish
permissions:
contents: read
id-token: write
steps:
# The publish script is the only repository file this job needs, and it
# imports nothing outside Node's builtins, so there is no install step.
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@v7.0.0
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Download npm tarballs
uses: actions/download-artifact@v8.0.1
with:
name: npm-tarballs
path: native/system/dist/npm
- name: Configure npm token fallback
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [[ -n "$NPM_TOKEN" ]]; then
echo "NODE_AUTH_TOKEN=$NPM_TOKEN" >> "$GITHUB_ENV"
fi
- name: Publish tarballs
# Publication is decided per package against the registry, so re-running
# this job over the same artifact skips what already landed instead of
# failing on it. A bare `npm publish` loop could not be retried: the
# registry answers a repeat of an existing version permanently.
run: node ./scripts/publish-release.mjs dist/npm