Skip to content

Commit d85a6eb

Browse files
committed
update release config for cross-compilation and trusted-publishing
1 parent 573b284 commit d85a6eb

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

.github/workflows/release.yaml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Build And Release
22

3-
on: [workflow_dispatch, push]
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
branches:
9+
- main
410

511
jobs:
612
Build:
@@ -75,6 +81,12 @@ jobs:
7581
with:
7682
submodules: true
7783

84+
- name: Update npm
85+
run: npm install -g npm@latest
86+
87+
- name: Install pnpm
88+
uses: pnpm/action-setup@v4
89+
7890
- name: Download Artifacts
7991
uses: actions/download-artifact@v3
8092

@@ -85,8 +97,26 @@ jobs:
8597
rm -rf bin-*
8698
sudo chmod -R +x bin
8799
100+
- name: Verify Binaries
101+
run: |
102+
// make sure all binaries are present
103+
if [ ! -f bin/dump-syms-linux-x64 ]; then echo "Missing bin/dump-syms-linux-x64" && exit 1; fi
104+
if [ ! -f bin/dump-syms-linux-arm64 ]; then echo "Missing bin/dump-syms-linux-arm64" && exit 1; fi
105+
if [ ! -f bin/dump-syms-macos-x64 ]; then echo "Missing bin/dump-syms-macos-x64" && exit 1; fi
106+
if [ ! -f bin/dump-syms-macos-arm64 ]; then echo "Missing bin/dump-syms-macos-arm64" && exit 1; fi
107+
if [ ! -f bin/dump-syms-windows-x64.exe ]; then echo "Missing bin/dump-syms-windows-x64.exe" && exit 1; fi
108+
if [ ! -f bin/dump-syms-windows-arm64.exe ]; then echo "Missing bin/dump-syms-windows-arm64.exe" && exit 1; fi
109+
110+
- name: Verify Version
111+
run: |
112+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
113+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
114+
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
115+
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
116+
exit 1
117+
fi
118+
88119
# this will only publish if the version has been updated
89120
- name: NPM Publish
90-
uses: JS-DevTools/[email protected]
91-
with:
92-
token: ${{secrets.NPM_TOKEN}}
121+
run: |
122+
npm publish

0 commit comments

Comments
 (0)