|
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,49 @@ jobs: |
74 | 80 | uses: actions/checkout@v3 |
75 | 81 | with: |
76 | 82 | 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 |
77 | 94 |
|
78 | 95 | - name: Download Artifacts |
79 | | - uses: actions/download-artifact@v3 |
| 96 | + uses: actions/download-artifact@v5 |
80 | 97 |
|
81 | 98 | - name: Fix Directory Structure |
82 | 99 | run: | |
83 | 100 | mkdir bin |
| 101 | + ls -la |
84 | 102 | mv bin-*/* bin/ |
85 | 103 | rm -rf bin-* |
| 104 | + ls -la bin |
86 | 105 | sudo chmod -R +x bin |
87 | 106 |
|
| 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 | +
|
88 | 125 | # this will only publish if the version has been updated |
89 | 126 | - name: NPM Publish |
90 | | - uses: JS-DevTools/[email protected] |
91 | | - with: |
92 | | - token: ${{secrets.NPM_TOKEN}} |
| 127 | + run: | |
| 128 | + npm publish |
0 commit comments