|
1 | 1 | name: Build And Release |
2 | 2 |
|
3 | | -on: [workflow_dispatch, push] |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - 'v*' |
| 8 | + branches: |
| 9 | + - main |
4 | 10 |
|
5 | 11 | jobs: |
6 | 12 | Build: |
@@ -74,19 +80,47 @@ jobs: |
74 | 80 | uses: actions/checkout@v3 |
75 | 81 | with: |
76 | 82 | 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 |
77 | 92 |
|
78 | 93 | - name: Download Artifacts |
79 | | - uses: actions/download-artifact@v3 |
| 94 | + uses: actions/download-artifact@v5 |
80 | 95 |
|
81 | 96 | - name: Fix Directory Structure |
82 | 97 | run: | |
83 | 98 | mkdir bin |
| 99 | + ls -la |
84 | 100 | mv bin-*/* bin/ |
85 | 101 | rm -rf bin-* |
86 | 102 | sudo chmod -R +x bin |
87 | 103 |
|
| 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 | +
|
88 | 123 | # this will only publish if the version has been updated |
89 | 124 | - name: NPM Publish |
90 | | - uses: JS-DevTools/[email protected] |
91 | | - with: |
92 | | - token: ${{secrets.NPM_TOKEN}} |
| 125 | + run: | |
| 126 | + npm publish |
0 commit comments