Merge pull request #16 from peek-travel/fix/timeslot-active-resource-… #12
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 | |
| # Publishes the package to the public npm registry when a version tag (e.g. | |
| # v0.1.0) is pushed. Cut a release by bumping the version and pushing the tag: | |
| # npm version patch # edits package.json + creates the git tag | |
| # git push --follow-tags | |
| # | |
| # Requires an NPM_TOKEN repository secret: an npm Automation access token with | |
| # publish rights to the @peektravel scope. | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org | |
| scope: '@peektravel' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify the tag matches package.json version | |
| run: | | |
| PKG_VERSION="$(node -p "require('./package.json').version")" | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION" >&2 | |
| exit 1 | |
| fi | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Lint | |
| run: npm run lint | |
| - name: Test (with coverage gate) | |
| run: npm run test:coverage | |
| # `npm publish` runs `prepublishOnly` first: build + publint + attw. | |
| - name: Publish | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |