Merge pull request #43 from chrisvander/fix-npm-publish #53
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: Test & Build | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
test-and-build: | |
name: Test & Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- run: bun i | |
- run: bun test | |
- run: bun run build | |
release-please: | |
name: Release Please | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
steps: | |
- id: release | |
uses: google-github-actions/release-please-action@v3 | |
with: | |
release-type: node | |
package-name: zustand-computed | |
release: | |
name: Create NPM Release | |
runs-on: ubuntu-latest | |
needs: [release-please, test-and-build] | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
registry-url: https://registry.npmjs.org/ | |
- run: bun i | |
- run: bun run build | |
- run: bun publish | |
env: | |
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} |