fix: pkg #111
Workflow file for this run
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 NPM" | |
on: | |
push: | |
tags: | |
- "v\\d+\\.\\d+\\.\\d+" | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node_version: [16, 18, 20] | |
include: | |
# Active LTS + other OS | |
- os: macos-latest | |
node_version: 18 | |
- os: windows-latest | |
node_version: 18 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- run: npm run ci-test | |
- run: npx codecov | |
try-publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- run: pnpm install | |
- run: npm run build | |
try-publish-create-halsp: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- run: pnpm install | |
- run: npm run build:create-halsp | |
publish-npm: | |
if: github.repository == 'halsp/cli' | |
needs: [test, try-publish-npm, try-publish-create-halsp] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- run: pnpm install | |
- run: npm run build | |
- run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
publish-create-halsp: | |
if: github.repository == 'halsp/cli' | |
needs: [test, try-publish-npm, try-publish-create-halsp] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- run: pnpm install | |
- run: npm run build:create-halsp | |
- run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
sync-cnpm: | |
if: github.repository == 'halsp/core' | |
needs: [publish-npm, publish-create-halsp] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- run: sh scripts/sync-cnpm.sh |