🔧 DEPS: Update @biomejs/biome to v2.3.11 (#587) #130
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 of your workflow | |
| name: NX release | |
| # Rules that trigger the workflow | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "packages/**" | |
| - "configs/**" | |
| env: | |
| # NX release needs to have a GH token in env.GITHUB_TOKEN | |
| # As during this workflow we will create a new release | |
| # that should trigger other workflow, we need to create custom TOKEN | |
| # with proper permissions, | |
| # more: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens | |
| GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| jobs: | |
| main: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🦖 Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.12.1 | |
| - name: 🔻 Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| # We need to pass Personal Access Token in order | |
| # to force triggering on-publish workflow | |
| token: ${{ secrets.PAT_TOKEN }} | |
| - name: 🏃 Run Node and NPM setup | |
| uses: ./.github/actions/setup-project | |
| - name: 🎯 Sets the base and head SHAs for the nx affected commands in CI | |
| uses: nrwl/nx-set-shas@v4 | |
| - name: 🔨 Build affected libs | |
| run: npx nx affected -t build | |
| # Generate release branch name with timestamp to avoid conflicts | |
| - name: 🏷️ Generate release branch name | |
| id: branch-name | |
| run: | | |
| TIMESTAMP=$(date +%Y%m%d-%H%M%S) | |
| BRANCH_NAME="release/auto-release-${TIMESTAMP}" | |
| echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT | |
| # Create and switch to release branch | |
| - name: 🌿 Create release branch | |
| run: | | |
| git checkout -b ${{ steps.branch-name.outputs.branch_name }} | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global push.autoSetupRemote true | |
| # Run nx release on the branch | |
| - name: 🚀 Run nx release | |
| id: nx-release | |
| run: | | |
| npx nx release --skip-publish | |
| # Check if there are any changes to commit | |
| if git diff --staged --quiet; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| # Push the release branch only if there are changes | |
| - name: 📤 Push release branch | |
| if: steps.nx-release.outputs.has_changes == 'true' | |
| run: | | |
| git push origin ${{ steps.branch-name.outputs.branch_name }} | |
| # Create pull request with auto-merge | |
| - name: 📋 Create Pull Request | |
| if: steps.nx-release.outputs.has_changes == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.PAT_TOKEN }} | |
| branch: ${{ steps.branch-name.outputs.branch_name }} | |
| base: main | |
| title: "chore: automated release" | |
| body: | | |
| ## Automated Release 🚀 | |
| This PR contains automated version updates and releases generated by NX. | |
| ### Changes | |
| - Version bumps and changelog updates | |
| - New releases created | |
| This PR will be automatically merged once all status checks pass. | |
| --- | |
| _Generated by GitHub Actions workflow_ | |
| labels: | | |
| release | |
| automated | |
| assignees: tutods | |
| delete-branch: true | |
| # Auto-merge the pull request | |
| - name: 🔄 Enable auto-merge | |
| if: steps.nx-release.outputs.has_changes == 'true' | |
| run: | | |
| # Wait a moment for PR to be fully created | |
| sleep 5 | |
| # Get the PR number from the branch | |
| PR_NUMBER=$(gh pr view ${{ steps.branch-name.outputs.branch_name }} --json number --jq '.number') | |
| # Enable auto-merge | |
| gh pr merge $PR_NUMBER --auto --squash | |
| env: | |
| GH_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| # Output information about the release | |
| - name: ✅ Release summary | |
| if: steps.nx-release.outputs.has_changes == 'true' | |
| run: | | |
| echo "✅ Release branch created: ${{ steps.branch-name.outputs.branch_name }}" | |
| echo "✅ Pull request created and set to auto-merge" | |
| echo "🔄 Waiting for status checks to pass before merging" | |
| - name: ℹ️ No changes summary | |
| if: steps.nx-release.outputs.has_changes == 'false' | |
| run: | | |
| echo "ℹ️ No changes detected - skipping release" |