Merge pull request #1526 from yamcodes/cursor/39107d3c #1836
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: | |
| - dev | |
| - v1 | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| release: | |
| name: Release | |
| # Skip release for autofix-ci[bot] pushes to preserve "publish exactly once". | |
| # Paired with autofix.yml's Version Packages skip: that guard stops autofix | |
| # from cancelling an in-flight release; this guard stops a re-triggered | |
| # release on an autofix fixup from double-publishing. Removing either | |
| # guard reopens a race (stranding or double-publish). | |
| # See docs/adr/0006-branching-and-release-flow.md. | |
| if: github.event.sender.login != 'autofix-ci[bot]' | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| steps: | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| client-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm run release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Sync main branch | |
| if: steps.changesets.outputs.published == 'true' && github.ref_name == 'dev' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main | |
| git checkout main | |
| git merge dev --ff-only | |
| git push origin main |