Skip to content

Commit 920c30e

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

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

.github/workflows/release.yaml

Lines changed: 39 additions & 5 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:
@@ -74,19 +80,47 @@ jobs:
7480
uses: actions/checkout@v3
7581
with:
7682
submodules: true
83+
84+
- name: Set up Node.js
85+
uses: actions/setup-node@v3
86+
with:
87+
node-version: '22'
88+
cache: 'pnpm'
89+
90+
- name: Update npm
91+
run: npm install -g npm@latest
7792

7893
- name: Download Artifacts
79-
uses: actions/download-artifact@v3
94+
uses: actions/download-artifact@v5
8095

8196
- name: Fix Directory Structure
8297
run: |
8398
mkdir bin
99+
ls -la
84100
mv bin-*/* bin/
85101
rm -rf bin-*
86102
sudo chmod -R +x bin
87103
104+
- name: Verify Binaries
105+
run: |
106+
// make sure all binaries are present
107+
if [ ! -f bin/dump-syms-linux-x64 ]; then echo "Missing bin/dump-syms-linux-x64" && exit 1; fi
108+
if [ ! -f bin/dump-syms-linux-arm64 ]; then echo "Missing bin/dump-syms-linux-arm64" && exit 1; fi
109+
if [ ! -f bin/dump-syms-macos-x64 ]; then echo "Missing bin/dump-syms-macos-x64" && exit 1; fi
110+
if [ ! -f bin/dump-syms-macos-arm64 ]; then echo "Missing bin/dump-syms-macos-arm64" && exit 1; fi
111+
if [ ! -f bin/dump-syms-windows-x64.exe ]; then echo "Missing bin/dump-syms-windows-x64.exe" && exit 1; fi
112+
if [ ! -f bin/dump-syms-windows-arm64.exe ]; then echo "Missing bin/dump-syms-windows-arm64.exe" && exit 1; fi
113+
114+
- name: Verify Version
115+
run: |
116+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
117+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
118+
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
119+
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
120+
exit 1
121+
fi
122+
88123
# this will only publish if the version has been updated
89124
- name: NPM Publish
90-
uses: JS-DevTools/[email protected]
91-
with:
92-
token: ${{secrets.NPM_TOKEN}}
125+
run: |
126+
npm publish

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"repository": {
44
"url": "https://github.com/gitkraken/node-dump-syms"
55
},
6-
"version": "0.0.3",
6+
"version": "0.0.4",
77
"main": "index.js",
88
"license": "MIT",
99
"scripts": {

0 commit comments

Comments
 (0)