Release #13
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm test | |
| - name: Create .npmrc file | |
| run: | | |
| cat > .npmrc << EOF | |
| //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | |
| EOF | |
| echo "Created .npmrc file" | |
| - name: Verify authentication | |
| id: auth_check | |
| continue-on-error: true | |
| run: | | |
| echo "Testing npm authentication..." | |
| npm whoami | |
| echo "Current registry: $(npm config get registry)" | |
| - name: Debug authentication failure | |
| if: steps.auth_check.outcome == 'failure' | |
| run: | | |
| echo "=== AUTHENTICATION FAILED - DEBUGGING ===" | |
| echo "=== All npm log files (newest first) ===" | |
| ls -lt /home/runner/.npm/_logs/*.log 2>/dev/null | head -10 || echo "No log files found" | |
| echo "=== Contents of latest debug log ===" | |
| LATEST_LOG=$(ls -t /home/runner/.npm/_logs/*debug*.log 2>/dev/null | head -1) | |
| if [ -n "$LATEST_LOG" ]; then | |
| echo "Reading: $LATEST_LOG" | |
| cat "$LATEST_LOG" | |
| else | |
| echo "No debug log found" | |
| fi | |
| echo "=== All log files content ===" | |
| find /home/runner/.npm/_logs -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \; | |
| echo "=== NPM Configuration ===" | |
| npm config list || true | |
| echo "=== .npmrc content ===" | |
| cat .npmrc || echo "No .npmrc found" | |
| echo "=== Environment variables ===" | |
| env | grep -E "(NPM|NODE)" || echo "No NPM/NODE env vars" | |
| exit 1 | |
| - name: Verify package info | |
| run: | | |
| echo "Package name: $(npm pkg get name)" | |
| echo "Package version: $(npm pkg get version)" | |
| - name: Publish to npm | |
| run: npm publish --access public --provenance |