-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.67 KB
/
Copy pathrelease.yaml
File metadata and controls
89 lines (73 loc) · 2.67 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
name: Release
on:
release:
types:
- published
workflow_dispatch:
inputs:
release_tag:
description: Existing release tag to verify or resume
required: true
type: string
env:
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.release_tag }}
permissions:
contents: read
id-token: write
jobs:
npm:
name: npm
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ env.RELEASE_TAG }}
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 24.18.0
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Install staged publishing npm CLI
run: npm install --global npm@11.15.0
- name: Install JavaScript development dependencies
run: npm ci
- name: Install stable Rust toolchain
run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown
- name: Install WebAssembly binding generator
uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b
with:
tool: wasm-bindgen-cli@0.2.127
fallback: none
- name: Verify release version
run: |
package_version=$(node --print "require('./packages/engine/package.json').version")
workspace_version=$(node --print "require('./package.json').version")
test "$package_version" = "$workspace_version"
test "$RELEASE_TAG" = "v$package_version"
release_commit=$(git rev-list --max-count=1 "$RELEASE_TAG")
test -n "$release_commit"
test "$(git rev-parse HEAD)" = "$release_commit"
git merge-base --is-ancestor "$release_commit" origin/main
- name: Build browser WebAssembly package
run: npm run build:wasm
- name: Test browser package
run: npm test
- name: Check browser package types
run: npm run typecheck
- name: Verify browser package contents
run: npm run pack:check
- name: Check whether version is already published
id: package
run: |
package_version=$(node --print "require('./packages/engine/package.json').version")
if npm view "@stack-sh/engine@$package_version" version >/dev/null 2>&1; then
echo "published=true" >> "$GITHUB_OUTPUT"
else
echo "published=false" >> "$GITHUB_OUTPUT"
fi
- name: Stage package for publishing
if: steps.package.outputs.published != 'true'
run: npm stage publish --workspace @stack-sh/engine --access public