Update typescript-eslint monorepo to v8.53.1 (#665) #378
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 NPM Package' | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dry-run: | |
| description: 'If true, skips commit on npm version and passes the --dry-run flag to npm publish. Useful for testing.' | |
| required: false | |
| default: 'false' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'package.json' | |
| jobs: | |
| publish: | |
| permissions: | |
| id-token: write # Required for OIDC | |
| runs-on: ubuntu-latest | |
| environment: main | |
| outputs: | |
| VERSION_TAG: ${{ steps.get-version-tag.outputs.VERSION_TAG }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: version-check | |
| run: | | |
| PACKAGE_VERSION=$(cat package.json \ | |
| | grep version \ | |
| | head -1 \ | |
| | awk -F: '{ print $2 }' \ | |
| | sed 's/[", ]//g') | |
| PUBLISHED_VERSION=$(npm show . version) | |
| # Check that the versions are different | |
| if [[ $PACKAGE_VERSION != $PUBLISHED_VERSION ]]; then | |
| echo "Current version ($PACKAGE_VERSION) is different than the published one ($PUBLISHED_VERSION), will publish" | |
| echo "SHOULD_PUBLISH=true" >> $GITHUB_OUTPUT | |
| fi | |
| - if: steps.version-check.outputs.SHOULD_PUBLISH == 'true' | |
| uses: ./.github/actions/setup | |
| - name: Install npm version needed for trusted publishing | |
| if: steps.version-check.outputs.SHOULD_PUBLISH == 'true' | |
| run: npm install -g npm@11 | |
| - if: steps.version-check.outputs.SHOULD_PUBLISH == 'true' | |
| run: yarn build | |
| - if: steps.version-check.outputs.SHOULD_PUBLISH == 'true' | |
| run: | | |
| params=(--access public) | |
| if [[ ${{ inputs.dry-run || 'false' }} == "true" ]]; then | |
| params+=(--dry-run) | |
| fi | |
| if ! npm publish "${params[@]}" ; then # scoped packages are restricted by default, but this is set because not all branches currently have a scoped package name in package.json | |
| echo "Failed to publish package" | |
| exit 1 | |
| fi | |
| working-directory: dist/src |