Rename package to 'scrappey' - v2.0.3 #7
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: Publish to NPM | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| publish: | |
| 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' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify package | |
| run: | | |
| echo "Package name: $(node -p "require('./package.json').name")" | |
| echo "Package version: $(node -p "require('./package.json').version")" | |
| - name: Publish to NPM | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| notify: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| if: success() | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get package info | |
| id: package | |
| run: | | |
| echo "name=$(node -p "require('./package.json').name")" >> $GITHUB_OUTPUT | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Summary | |
| run: | | |
| echo "## 🎉 Published to NPM!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Package:** ${{ steps.package.outputs.name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Version:** ${{ steps.package.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Install with:" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY | |
| echo "npm install ${{ steps.package.outputs.name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |