update ci #3
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 | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Step 1: Checkout the latest code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# Step 2: Install Node.js and pnpm | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'pnpm' | ||
check-latest: true | ||
# Step 3: Install pnpm | ||
- name: Install pnpm | ||
run: | | ||
npm install -g pnpm | ||
pnpm config set store-dir ~/.pnpm-store | ||
# Step 4: Install dependencies using pnpm | ||
- name: Install dependencies | ||
run: pnpm install | ||
# Step 5: Run linting | ||
- name: Lint code | ||
run: pnpm run lint | ||
# Step 6: Run tests | ||
- name: Run tests | ||
run: pnpm run test | ||
# Step 7: Build the library | ||
- name: Build the library | ||
run: pnpm run build | ||
# Step 8: Publish to NPM (on successful build) | ||
- name: Publish to NPM | ||
if: github.ref == 'refs/heads/main' | ||
run: pnpm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets | ||
Check failure on line 52 in .github/workflows/publish-to-npm.yml GitHub Actions / Publish to NPMInvalid workflow file
|