Skip to content

Commit 5409c88

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

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

.github/workflows/release.yaml

Lines changed: 41 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,49 @@ jobs:
7480
uses: actions/checkout@v3
7581
with:
7682
submodules: true
83+
84+
- name: Install pnpm
85+
uses: pnpm/action-setup@v4
86+
87+
- name: Installing NodeJS
88+
uses: actions/setup-node@v4
89+
with:
90+
node-version: '22'
91+
92+
- name: Update npm
93+
run: npm install -g npm@latest
7794

7895
- name: Download Artifacts
79-
uses: actions/download-artifact@v3
96+
uses: actions/download-artifact@v5
8097

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