eslint-config-es5-v4.0.1 #4
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 @forumone/eslint-config-es5 on GitHub | |
| on: | |
| release: | |
| types: [published] # Triggers when you create a GitHub release | |
| jobs: | |
| publish-registry: | |
| # Only run for releases tagged for this package, e.g. eslint-config-es5-v4.0.1 | |
| if: startsWith(github.event.release.tag_name, 'eslint-config-es5-v') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./packages/eslint-config-forumone-es5 | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node for GitHub Packages | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@forumone' | |
| - name: Validate release tag matches package version | |
| env: | |
| ACTUAL_TAG: ${{ github.event.release.tag_name }} | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| EXPECTED_TAG="eslint-config-es5-v$VERSION" | |
| if [[ "$ACTUAL_TAG" != "$EXPECTED_TAG" ]]; then | |
| echo "Release tag '$ACTUAL_TAG' does not match expected tag '$EXPECTED_TAG' (package.json version $VERSION)" >&2 | |
| exit 1 | |
| fi | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Determine npm dist-tag | |
| # For example: | |
| # - 4.0.1-alpha.1 → publishes under dist-tag alpha. | |
| # - 4.0.1 (i.e. a stable release) → publishes under dist-tag latest, the default | |
| id: npm-tag | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then | |
| echo "tag=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=latest" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish to GitHub Packages | |
| run: npm publish --tag ${{ steps.npm-tag.outputs.tag }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |