Skip to content

test: add test for import #115

test: add test for import

test: add test for import #115

Workflow file for this run

name: "Publish NPM"
on:
push:
tags:
- "v\\d+\\.\\d+\\.\\d+"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18, 20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- uses: pnpm/action-setup@v3
with:
version: 8
- run: npm run ci-test
- run: npx codecov
try-publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install
- run: npm run build
try-publish-create-halsp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v3
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@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v3
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@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v3
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@v4
- run: sh scripts/sync-cnpm.sh