|
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 |
| 10 | + |
| 11 | +permissions: |
| 12 | + id-token: write |
4 | 13 |
|
5 | 14 | jobs: |
6 | 15 | Build: |
@@ -74,19 +83,49 @@ jobs: |
74 | 83 | uses: actions/checkout@v3 |
75 | 84 | with: |
76 | 85 | 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 |
77 | 97 |
|
78 | 98 | - name: Download Artifacts |
79 | | - uses: actions/download-artifact@v3 |
| 99 | + uses: actions/download-artifact@v5 |
80 | 100 |
|
81 | 101 | - name: Fix Directory Structure |
82 | 102 | run: | |
83 | 103 | mkdir bin |
| 104 | + ls -la |
84 | 105 | mv bin-*/* bin/ |
85 | 106 | rm -rf bin-* |
| 107 | + ls -la bin |
86 | 108 | sudo chmod -R +x bin |
87 | 109 |
|
| 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 | +
|
88 | 128 | # this will only publish if the version has been updated |
89 | 129 | - name: NPM Publish |
90 | | - uses: JS-DevTools/[email protected] |
91 | | - with: |
92 | | - token: ${{secrets.NPM_TOKEN}} |
| 130 | + run: | |
| 131 | + npm publish |
0 commit comments