v2.0.2 - Packaging cleanup #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Node.js Package | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js (with Corepack/Yarn) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'yarn' | |
| - run: corepack enable | |
| - name: Init submodules | |
| run: git submodule update --init --recursive | |
| - name: Install Zig | |
| uses: ./.github/actions/setup-zig | |
| - name: Install deps (Yarn 4 workspaces) | |
| run: yarn install --immutable | |
| - name: Ensure version not already on npm | |
| run: | | |
| NAME="$(node -p "require('./package.json').name")" | |
| VER="$(node -p "require('./package.json').version")" | |
| if npm view "${NAME}@${VER}" version >/dev/null 2>&1; then | |
| echo "::error::${NAME}@${VER} already exists on npm" | |
| exit 1 | |
| fi | |
| - name: Build Zig prebuilts for Android | |
| run: ./scripts/build-zig-android.sh | |
| - name: Build Zig prebuilts for iOS | |
| run: ./scripts/build-zig-ios.sh | |
| - name: Build package (bob via prepare) | |
| run: yarn prepare | |
| - name: Verify packaged artifacts | |
| run: yarn check:packaged-artifacts | |
| - name: Publish to npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public |