From 363c30d732f386779e67a10c256dc02e116a7622 Mon Sep 17 00:00:00 2001 From: Harrison Weinstock Date: Thu, 21 May 2026 17:10:45 +0000 Subject: [PATCH 1/4] ci: add preview tarball workflow for prerelease builds --- .github/workflows/preview-tarball.yml | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/preview-tarball.yml diff --git a/.github/workflows/preview-tarball.yml b/.github/workflows/preview-tarball.yml new file mode 100644 index 000000000..976b906ce --- /dev/null +++ b/.github/workflows/preview-tarball.yml @@ -0,0 +1,54 @@ +name: Preview Tarball + +on: + push: + branches: [main] + # Manually trigger to pull in the latest CDK constructs changes + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: preview-tarball + cancel-in-progress: true + +jobs: + preview-tarball: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: '22.x' + cache: 'npm' + - uses: astral-sh/setup-uv@v7 + - run: npm run bundle + - name: Get tarball info + id: tarball + run: | + TARBALL_NAME=$(ls *.tgz | head -1 | xargs basename) + echo "name=$TARBALL_NAME" >> $GITHUB_OUTPUT + - name: Generate GitHub App Token + id: app-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Create or update prerelease + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + TARBALL_NAME: ${{ steps.tarball.outputs.name }} + run: | + TAG="prerelease" + + # Delete existing release if it exists (to update the tarball) + gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true + + # Create a new pre-release with the tarball + gh release create "$TAG" \ + "${TARBALL_NAME}" \ + --title "Preview (prerelease)" \ + --notes "Auto-generated tarball from the latest commit on main." \ + --prerelease \ + --target "${{ github.sha }}" From 23c65d1ab15cf06ac10b23527e419fcd1c2e7b34 Mon Sep 17 00:00:00 2001 From: Harrison Weinstock Date: Thu, 21 May 2026 17:14:36 +0000 Subject: [PATCH 2/4] ci: use default GITHUB_TOKEN instead of app token --- .github/workflows/preview-tarball.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/preview-tarball.yml b/.github/workflows/preview-tarball.yml index 976b906ce..0971a443d 100644 --- a/.github/workflows/preview-tarball.yml +++ b/.github/workflows/preview-tarball.yml @@ -29,15 +29,9 @@ jobs: run: | TARBALL_NAME=$(ls *.tgz | head -1 | xargs basename) echo "name=$TARBALL_NAME" >> $GITHUB_OUTPUT - - name: Generate GitHub App Token - id: app-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - name: Create or update prerelease env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TARBALL_NAME: ${{ steps.tarball.outputs.name }} run: | TAG="prerelease" From 9541dded93258024dfe2db2512d5e57906e816a7 Mon Sep 17 00:00:00 2001 From: Harrison Weinstock Date: Thu, 21 May 2026 17:17:14 +0000 Subject: [PATCH 3/4] ci: use node 20.x for consistency --- .github/workflows/preview-tarball.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-tarball.yml b/.github/workflows/preview-tarball.yml index 0971a443d..2255bafbd 100644 --- a/.github/workflows/preview-tarball.yml +++ b/.github/workflows/preview-tarball.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: - node-version: '22.x' + node-version: '20.x' cache: 'npm' - uses: astral-sh/setup-uv@v7 - run: npm run bundle From d51203158f06ab9c0b204f23c4f82ca3bededa82 Mon Sep 17 00:00:00 2001 From: Harrison Weinstock Date: Thu, 21 May 2026 21:19:35 +0000 Subject: [PATCH 4/4] ci: rename preview to prerelease --- .../{preview-tarball.yml => prerelease-tarball.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{preview-tarball.yml => prerelease-tarball.yml} (91%) diff --git a/.github/workflows/preview-tarball.yml b/.github/workflows/prerelease-tarball.yml similarity index 91% rename from .github/workflows/preview-tarball.yml rename to .github/workflows/prerelease-tarball.yml index 2255bafbd..70be0d6aa 100644 --- a/.github/workflows/preview-tarball.yml +++ b/.github/workflows/prerelease-tarball.yml @@ -1,4 +1,4 @@ -name: Preview Tarball +name: Prerelease Tarball on: push: @@ -10,11 +10,11 @@ permissions: contents: write concurrency: - group: preview-tarball + group: prerelease-tarball cancel-in-progress: true jobs: - preview-tarball: + prerelease-tarball: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -42,7 +42,7 @@ jobs: # Create a new pre-release with the tarball gh release create "$TAG" \ "${TARBALL_NAME}" \ - --title "Preview (prerelease)" \ + --title "Prerelease" \ --notes "Auto-generated tarball from the latest commit on main." \ --prerelease \ --target "${{ github.sha }}"