feat: enable useBlockStatements and useConsistentTypeDefinitions (#74) #136
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| # Step 1: Release Please analyzes commits since the last release. | |
| # - If there are releasable changes: opens/updates a "Release PR" with version bumps + changelogs. | |
| # - If a Release PR was just merged: creates GitHub releases and signals that publishing should happen. | |
| release-please: | |
| name: Create release PR | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| paths_released: ${{ steps.release.outputs.paths_released }} | |
| steps: | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.NIMBLE_GH_APP_ID }} | |
| private-key: ${{ secrets.NIMBLE_GH_APP_PRIVATE_KEY }} | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| # Step 2: Publish to npm — only runs when a Release PR was merged in the push that triggered this workflow | |
| publish: | |
| name: Publish to npm | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.releases_created == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # registry-url is required for npm publish authentication via NODE_AUTH_TOKEN | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build packages | |
| run: npx turbo run build | |
| # Loop through all packages and publish any that have a new version. | |
| # Checks the registry first to avoid failing on already-published versions. | |
| - name: Publish packages | |
| run: | | |
| for dir in packages/*/; do | |
| if [ -f "$dir/package.json" ]; then | |
| name=$(node -p "require('./$dir/package.json').name") | |
| version=$(node -p "require('./$dir/package.json').version") | |
| published=$(npm view "$name@$version" version 2>/dev/null || echo "") | |
| if [ "$published" != "$version" ]; then | |
| echo "Publishing $name@$version..." | |
| npm publish "$dir" --access public | |
| else | |
| echo "Skipping $name@$version (already published)" | |
| fi | |
| fi | |
| done | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |