Skip to content

Commit 47a794b

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

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

.github/workflows/release.yaml

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

3-
on: [workflow_dispatch, push]
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
48

59
jobs:
610
Build:
@@ -75,6 +79,12 @@ jobs:
7579
with:
7680
submodules: true
7781

82+
- name: Update npm
83+
run: npm install -g npm@latest
84+
85+
- name: Install pnpm
86+
uses: pnpm/action-setup@v4
87+
7888
- name: Download Artifacts
7989
uses: actions/download-artifact@v3
8090

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

0 commit comments

Comments
 (0)