From 6b138bcab741101fc5ac8c0be40e8faf8ee64ccb Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 8 Jun 2026 21:48:28 +0100 Subject: [PATCH] ci: migrate release workflow to uppt --- .github/workflows/release.yml | 75 ++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c500e2c7..1833427b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,25 +1,72 @@ -name: Release - -permissions: - contents: write +name: release on: push: - tags: - - 'v*' + branches: [main] + pull_request: + types: [closed] + branches: [main] workflow_dispatch: +permissions: {} + jobs: + pr: + if: github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: danielroe/uppt/pr@4e0c42a0fd6091f59e5dfe168e69b57651e87bed # v0.5.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release: + if: | + github.event_name == 'pull_request' + && github.event.pull_request.merged == true + && startsWith(github.event.pull_request.head.ref, 'release/v') + && github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest + concurrency: + group: release-${{ github.event.pull_request.number }} + cancel-in-progress: false + permissions: + contents: write + actions: write steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - run: corepack enable - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + - uses: danielroe/uppt/release@4e0c42a0fd6091f59e5dfe168e69b57651e87bed # v0.5.4 with: - node-version: lts/* - cache: 'pnpm' + token: ${{ secrets.GITHUB_TOKEN }} - - run: npx changelogithub - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pack: + if: github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + concurrency: + group: pack-${{ github.ref }} + cancel-in-progress: false + permissions: {} + outputs: + files: ${{ steps.pack.outputs.files }} + steps: + - id: pack + uses: danielroe/uppt/pack@4e0c42a0fd6091f59e5dfe168e69b57651e87bed # v0.5.4 + + publish: + if: | + github.event_name == 'workflow_dispatch' + && startsWith(github.ref, 'refs/tags/v') + && needs.pack.outputs.files != '[]' + needs: pack + runs-on: ubuntu-latest + concurrency: + group: publish-${{ github.ref }} + cancel-in-progress: false + permissions: + id-token: write + environment: npm + steps: + - uses: danielroe/uppt/publish@4e0c42a0fd6091f59e5dfe168e69b57651e87bed # v0.5.4 + with: + files: ${{ needs.pack.outputs.files }}