-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (181 loc) · 7.12 KB
/
Copy pathrelease.yml
File metadata and controls
189 lines (181 loc) · 7.12 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
189
name: Release shared JavaScript runtime
on:
workflow_dispatch:
inputs:
registry:
description: Publish npm from an immutable release tag
required: true
type: choice
default: validate-only
options:
- validate-only
- npm
permissions:
contents: read
jobs:
contract:
name: Validate immutable release identity
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v6
with: { persist-credentials: false }
- uses: actions/setup-node@v6
with: { node-version: "24", package-manager-cache: false }
- uses: dtolnay/rust-toolchain@1.95
with: { components: rustfmt }
- id: version
shell: bash
run: |
./scripts/verify.sh
version=$(node -p 'require("./release/version.json").canonical')
node scripts/check-release-ref.mjs \
--ref "$GITHUB_REF" \
--ref-name "$GITHUB_REF_NAME" \
--registry "${{ inputs.registry }}"
echo "version=$version" >> "$GITHUB_OUTPUT"
native-prebuild:
name: Native ${{ matrix.os }} / ${{ matrix.arch }}
needs: contract
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, arch: x64, platform: linux-x64 }
- { os: ubuntu-24.04-arm, arch: arm64, platform: linux-arm64 }
- { os: macos-15-intel, arch: x64, platform: darwin-x64 }
- { os: macos-15, arch: arm64, platform: darwin-arm64 }
- { os: windows-2025, arch: x64, platform: win32-x64 }
- { os: windows-11-arm, arch: arm64, platform: win32-arm64 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with: { persist-credentials: false }
- uses: actions/setup-node@v6
with: { node-version: "24", architecture: "${{ matrix.arch }}", package-manager-cache: false }
- name: Checkout immutable family sources
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/checkout-family-sources.mjs --parent "$GITHUB_WORKSPACE/.."
- uses: dtolnay/rust-toolchain@1.95
- name: Install build tool and local interop type package
shell: bash
run: >-
npm install --ignore-scripts --no-save node-gyp@13.0.1
"@vinary-tree/vinary-tree-interop@file:../vinary-tree-interop/bindings/javascript"
- name: Build relocatable SDK and native addon
shell: bash
env:
VINARY_TREE_INTEROP_ROOT: ${{ github.workspace }}/../vinary-tree-interop
VINARY_TREE_LLATTICE_ROOT: ${{ github.workspace }}/../llattice
VINARY_TREE_LIBDICTENSTEIN_ROOT: ${{ github.workspace }}/../libdictenstein
VINARY_TREE_LIBLEVENSHTEIN_ROOT: ${{ github.workspace }}/../liblevenshtein-rust
VINARY_TREE_LLING_LLANG_ROOT: ${{ github.workspace }}/../lling-llang
VINARY_TREE_DUALLITY_ROOT: ${{ github.workspace }}/../duallity
run: |
npm run bootstrap:native
npm run build:native:release
npm run test:native
npm run test:leak
npm run stage:native
- uses: actions/upload-artifact@v7
with:
name: native-${{ matrix.platform }}
path: native/prebuilds
if-no-files-found: error
webassembly:
name: Browser WASM and WASI artifacts
needs: contract
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with: { persist-credentials: false }
- uses: actions/setup-node@v6
with: { node-version: "24", package-manager-cache: false }
- name: Checkout immutable family sources
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/checkout-family-sources.mjs --parent "$GITHUB_WORKSPACE/.."
- uses: dtolnay/rust-toolchain@1.95
with: { targets: "wasm32-unknown-unknown,wasm32-wasip1" }
- uses: jetli/wasm-pack-action@v0.4.0
with: { version: v0.13.1 }
- run: bash .github/setup-binaryen.sh
- name: Install local interop type package
run: >-
npm install --ignore-scripts --no-save
"@vinary-tree/vinary-tree-interop@file:../vinary-tree-interop/bindings/javascript"
- name: Build and test both WebAssembly hosts
env:
VINARY_TREE_INTEROP_ROOT: ${{ github.workspace }}/../vinary-tree-interop
VINARY_TREE_LLATTICE_ROOT: ${{ github.workspace }}/../llattice
VINARY_TREE_LIBDICTENSTEIN_ROOT: ${{ github.workspace }}/../libdictenstein
VINARY_TREE_LIBLEVENSHTEIN_ROOT: ${{ github.workspace }}/../liblevenshtein-rust
VINARY_TREE_LLING_LLANG_ROOT: ${{ github.workspace }}/../lling-llang
VINARY_TREE_DUALLITY_ROOT: ${{ github.workspace }}/../duallity
run: |
npm run configure:local
npm run build:wasm
npm run build:wasi
npm test
- uses: actions/upload-artifact@v7
with:
name: webassembly
path: generated
if-no-files-found: error
assemble:
name: Assemble and inspect npm tarball
needs: [contract, native-prebuild, webassembly]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with: { persist-credentials: false }
- uses: actions/setup-node@v6
with: { node-version: "24", package-manager-cache: false }
- uses: actions/download-artifact@v7
with: { pattern: native-*, path: native/prebuilds, merge-multiple: true }
- uses: actions/download-artifact@v7
with: { name: webassembly, path: generated }
- run: npm install --ignore-scripts
- run: npm run verify:prebuilds
- run: npm run verify:package
- run: mkdir dist && npm pack --ignore-scripts --pack-destination dist
- uses: actions/upload-artifact@v7
with:
name: npm-package
path: dist/*.tgz
if-no-files-found: error
publish-npm:
name: Publish npm under next
needs: [contract, assemble]
if: github.event_name == 'workflow_dispatch' && github.ref_type == 'tag' && inputs.registry == 'npm'
runs-on: ubuntu-24.04
environment: npm
permissions: { id-token: write }
steps:
- uses: actions/setup-node@v6
with: { node-version: "24", registry-url: "https://registry.npmjs.org", package-manager-cache: false }
- uses: actions/download-artifact@v7
with: { name: npm-package, path: dist }
- run: npm publish --access public --provenance --tag next ./dist/*.tgz
github-release:
name: Publish checksummed runtime release
needs: [contract, assemble]
if: >-
github.event_name == 'workflow_dispatch' &&
github.ref_type == 'tag' &&
inputs.registry == 'validate-only'
runs-on: ubuntu-24.04
environment: github-release
permissions: { contents: write }
steps:
- uses: actions/download-artifact@v7
with: { name: npm-package, path: assets }
- run: sha256sum assets/*.tgz > assets/SHA256SUMS
- uses: softprops/action-gh-release@v2
with:
files: assets/*
prerelease: ${{ contains(github.ref_name, '-') }}
generate_release_notes: true