ci: add CI to publish to gcr

This commit is contained in:
Huakun Shen 2025-01-19 22:53:54 -05:00
parent 45bff407ab
commit ebf898b510
No known key found for this signature in database

37
.github/workflows/gcr-publish.yml vendored Normal file
View File

@ -0,0 +1,37 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on:
push:
branches: [dev]
release:
types: [created]
jobs:
publish-gpr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v2
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# subject-digest: 'sha256:fedcba0...'
# push-to-registry: true