Readme node version (#103) #22
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: Publish to NPM | |
on: | |
push: | |
branches: | |
- main # Only run on pushes to the main branch | |
tags: | |
- '*.*.*' # Stable releases | |
- '*-alpha.*' # Alpha releases | |
- '*-beta.*' # Beta releases | |
- '*-canary.*' # Canary releases | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10.x | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Debug Git status | |
run: git status --porcelain | |
- name: Run tests | |
run: pnpm test:ci | |
- name: Lint code | |
run: pnpm lint | |
- name: Build project | |
run: pnpm run build | |
- name: Publish package to NPM | |
run: | | |
if [[ "${{ github.ref_name }}" == *-alpha* ]]; then | |
pnpm publish --access public --tag alpha | |
elif [[ "${{ github.ref_name }}" == *-beta* ]]; then | |
pnpm publish --access public --tag beta | |
elif [[ "${{ github.ref_name }}" == *-canary* ]]; then | |
pnpm publish --access public --tag canary | |
else | |
pnpm publish --access public | |
fi | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |