From 07c0dd80fc25e81e67adf9398d34b93e0a4495e1 Mon Sep 17 00:00:00 2001 From: vabatta <2137077+vabatta@users.noreply.github.com> Date: Mon, 9 Mar 2026 01:12:24 +0100 Subject: [PATCH 1/2] ci: rebuild dist artifacts on release-please PRs --- .github/workflows/scripts-cd.yaml | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/scripts-cd.yaml b/.github/workflows/scripts-cd.yaml index ab545bc..aaf6b11 100644 --- a/.github/workflows/scripts-cd.yaml +++ b/.github/workflows/scripts-cd.yaml @@ -19,3 +19,56 @@ jobs: runs-on: ubuntu-latest steps: - uses: googleapis/release-please-action@v4 + + rebuild-dist: + name: Rebuild dist for release PRs + needs: release-please + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Find release-please branches + id: check + run: | + components="" + for component in cz dotenv jwt theme; do + branch="release-please--branches--main--components--${component}" + if git ls-remote --exit-code origin "refs/heads/${branch}" > /dev/null 2>&1; then + components="${components} ${component}" + fi + done + components="${components# }" + echo "components=$components" >> "$GITHUB_OUTPUT" + echo "found=$([[ -n "$components" ]] && echo true || echo false)" >> "$GITHUB_OUTPUT" + + - if: steps.check.outputs.found == 'true' + uses: cachix/install-nix-action@v31 + + - if: steps.check.outputs.found == 'true' + name: Rebuild and push dist artifacts + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + for component in ${{ steps.check.outputs.components }}; do + branch="release-please--branches--main--components--${component}" + echo "::group::${component}" + git fetch origin "${branch}" + git checkout "${branch}" + + nix develop --command make build NAME="${component}" + + git add "dist/${component}/" + if ! git diff --cached --quiet; then + git commit -m "chore: rebuild dist for ${component}" + git push origin "${branch}" + echo "Pushed updated dist for ${component}" + else + echo "No dist changes for ${component}" + fi + + git checkout main + echo "::endgroup::" + done From 93168038cf003e5346cb1d5fbaf704a66f5e87b9 Mon Sep 17 00:00:00 2001 From: vabatta <2137077+vabatta@users.noreply.github.com> Date: Mon, 9 Mar 2026 01:20:45 +0100 Subject: [PATCH 2/2] ci: use nix develop shell for dist rebuild step --- .github/workflows/scripts-cd.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts-cd.yaml b/.github/workflows/scripts-cd.yaml index aaf6b11..d95658e 100644 --- a/.github/workflows/scripts-cd.yaml +++ b/.github/workflows/scripts-cd.yaml @@ -46,8 +46,13 @@ jobs: - if: steps.check.outputs.found == 'true' uses: cachix/install-nix-action@v31 + - if: steps.check.outputs.found == 'true' + name: Pre-build devShell + run: nix build --no-link '.#devShells.'$(nix eval --impure --raw --expr builtins.currentSystem)'.default' + - if: steps.check.outputs.found == 'true' name: Rebuild and push dist artifacts + shell: nix develop -c bash -e {0} run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -58,7 +63,7 @@ jobs: git fetch origin "${branch}" git checkout "${branch}" - nix develop --command make build NAME="${component}" + make build NAME="${component}" git add "dist/${component}/" if ! git diff --cached --quiet; then