Publish to NPM and GitHub (#2) #3
This file contains 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: CI Main | |
on: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Run CI | |
run: bun run ci | |
- name: Publish to NPM package registry | |
# https://github.com/oven-sh/bun/issues/1976 | |
run: | | |
echo "@secretkeylabs:registry=https://registry.npmjs.org/" > .npmrc | |
echo "//registry.npmjs.org/:_authToken=$AUTH_TOKEN" >> .npmrc | |
bunx npm@latest publish --access=public --tag=latest | |
env: | |
AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }} | |
- name: Publish to GitHub package registry | |
# https://github.com/oven-sh/bun/issues/1976 | |
run: | | |
echo "@secretkeylabs:registry=https://npm.pkg.github.com/" > .npmrc | |
echo "//npm.pkg.github.com/:_authToken=$AUTH_TOKEN" >> .npmrc | |
bunx npm@latest publish --access=public --tag=latest | |
env: | |
AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |