chore(release): 1.3.8 🚀 #21
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: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish: | |
| name: Publish package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| registry-url: https://registry.npmjs.org | |
| scope: "@programinglive" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run build | |
| - name: Verify tag matches package version | |
| run: | | |
| EXPECTED_TAG="${GITHUB_REF#refs/tags/}" | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| if [ "v${PACKAGE_VERSION}" != "${EXPECTED_TAG}" ]; then | |
| echo "Package version ${PACKAGE_VERSION} does not match tag ${EXPECTED_TAG}" | |
| exit 1 | |
| fi | |
| - name: Publish to npm | |
| run: npm publish --provenance |