Skip to content

Commit 657334c

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

File tree

2 files changed

+45
-6
lines changed

2 files changed

+45
-6
lines changed

.github/workflows/release.yaml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
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
10+
11+
permissions:
12+
id-token: write
413

514
jobs:
615
Build:
@@ -74,19 +83,49 @@ jobs:
7483
uses: actions/checkout@v3
7584
with:
7685
submodules: true
86+
87+
- name: Install pnpm
88+
uses: pnpm/action-setup@v4
89+
90+
- name: Installing NodeJS
91+
uses: actions/setup-node@v4
92+
with:
93+
node-version: '22'
94+
95+
- name: Update npm
96+
run: npm install -g npm@latest
7797

7898
- name: Download Artifacts
79-
uses: actions/download-artifact@v3
99+
uses: actions/download-artifact@v5
80100

81101
- name: Fix Directory Structure
82102
run: |
83103
mkdir bin
104+
ls -la
84105
mv bin-*/* bin/
85106
rm -rf bin-*
107+
ls -la bin
86108
sudo chmod -R +x bin
87109
110+
- name: Verify Binaries
111+
run: |
112+
if [ ! -f bin/linux-x64/dump_syms ]; then echo "Missing bin/linux-x64/dump_syms" && exit 1; fi
113+
if [ ! -f bin/linux-arm64/dump_syms ]; then echo "Missing bin/linux-arm64/dump_syms" && exit 1; fi
114+
if [ ! -f bin/darwin-x64/dump_syms ]; then echo "Missing bin/darwin-x64/dump_syms" && exit 1; fi
115+
if [ ! -f bin/darwin-arm64/dump_syms ]; then echo "Missing bin/darwin-arm64/dump_syms" && exit 1; fi
116+
if [ ! -f bin/win32-x64/dump_syms.exe ]; then echo "Missing bin/win32-x64/dump_syms.exe" && exit 1; fi
117+
if [ ! -f bin/win32-arm64/dump_syms.exe ]; then echo "Missing bin/win32-arm64/dump_syms.exe" && exit 1; fi
118+
119+
- name: Verify Version
120+
run: |
121+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
122+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
123+
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
124+
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
125+
exit 1
126+
fi
127+
88128
# this will only publish if the version has been updated
89129
- name: NPM Publish
90-
uses: JS-DevTools/[email protected]
91-
with:
92-
token: ${{secrets.NPM_TOKEN}}
130+
run: |
131+
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)