Add pnpm as a dependency manager and update workflow*** #2
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: Build and Publish | |
on: | |
push: | |
branches: | |
- main # or your default branch | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' # or the version you're using | |
registry-url: 'https://registry.npmjs.org/' | |
cache: 'pnpm' | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Change to project directory | |
run: cd bambujs | |
- name: Install dependencies with pnpm | |
run: pnpm install | |
working-directory: ./bambujs | |
- name: Build with tsup | |
run: pnpm exec tsup | |
working-directory: ./bambujs | |
- name: Publish to npm | |
run: pnpm publish --access public | |
working-directory: ./bambujs | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |