name: npm release on: release: types: [published] permissions: contents: read id-token: write concurrency: group: npm-release cancel-in-progress: false jobs: publish: if: startsWith(github.event.release.tag_name, 'clients-v') runs-on: ubuntu-24.04 environment: npm steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.release.tag_name }} - uses: actions/setup-node@v6 with: node-version: 24 registry-url: https://registry.npmjs.org package-manager-cache: false - uses: oven-sh/setup-bun@v2 with: bun-version: 1.4.0 - name: Validate verifier version env: RELEASE_TAG: ${{ github.event.release.tag_name }} run: | version="${RELEASE_TAG#clients-v}" test "$(node -p "require('./clients/verifier-ts/package.json').version")" = "$version" - name: Install clients working-directory: clients run: npm ci - name: Verify release artifacts run: | npm --prefix clients run build npm --prefix clients run check npm --prefix clients test npm --prefix clients run test:bun npm --prefix clients run lint:packages bash clients/package-smoke.sh - name: Publish verifier run: | publish_if_missing() { name="$1" directory="$2" version="$(node -p "require('./$directory/package.json').version")" if npm view "$name@$version" version >/dev/null 2>&1; then echo "$name@$version is already published; skipping" else npm publish "./$directory" --access public --provenance fi } publish_if_missing @phala/aci-verifier clients/verifier-ts