Skip to content

Commit 3ae17e4

Browse files
authored
fix(ci): auto-update lockfiles and label release PRs (#483)
* fix(handlebarrz): use setup job for platform flags instead of env context GitHub Actions doesn't allow using `env` context in job-level `if` conditions. Refactored to use a setup job that outputs platform flags, which other jobs reference via `needs.setup.outputs.*`. Platform defaults are now configured in the setup job's shell script: - DEFAULT_LINUX_ARM64="true" - DEFAULT_LINUX_X86_64="true" - DEFAULT_ALPINE_ARM64="true" - DEFAULT_ALPINE_X86_64="true" - DEFAULT_MACOS_ARM64="true" - DEFAULT_MACOS_X86_64="true" - DEFAULT_WINDOWS_X86_64="false" For workflow_dispatch, inputs override these defaults. For release events, these defaults are used. * chore: update MODULE.bazel.lock for all platforms Regenerate the Bazel module lock file to ensure consistency across all language builds (Go, Java, Python, Rust, TypeScript). * test(handlebarrz): add numeric and boolean value tests Add TestNumericAndBooleanValues test class covering: - Integer values (positive, zero, negative) - Float values (decimal, zero, negative) - Boolean values in conditionals - None/null value handling - Large numbers - Scientific notation * fix(ci): enable lockfile updates for release PRs Re-enable the update-lockfiles job in release-please workflow to automatically update MODULE.bazel.lock and other lockfiles when release-please creates release PRs. Changes: - Use matrix strategy to process each separate release PR - Add prs and prs_created outputs from release-please - Update lockfiles: MODULE.bazel.lock, Cargo.lock, go.mod, uv.lock, pnpm-lock.yaml - Use RELEASE_PLEASE_TOKEN for checkout and push permissions * feat(ci): add automatic labels for release-please PRs Add labeler rules to automatically label release PRs created by release-please, making them easier to find and filter. Labels added: - release: All release-please PRs - release/dotprompt: JS/TS dotprompt releases - release/dotpromptz: Python dotpromptz releases - release/dotpromptz-handlebars: Python handlebarrz releases - release/dotprompt-go: Go releases - release/dotprompt-rs: Rust releases - release/dotprompt-java: Java releases - release/vscode: VS Code extension releases - release/vim: Vim plugin releases - release/emacs: Emacs plugin releases - release/jetbrains: JetBrains plugin releases - release/monaco: Monaco editor releases - release/codemirror: CodeMirror releases - release/treesitter: Tree-sitter grammar releases - release/promptly: Promptly CLI releases Also fixed quoting on existing branch pattern regexes. * fix(handlebarrz): correct float test expectation for 0.0 * perf(handlebarrz): add sccache to publish workflow for faster builds Add sccache (Rust compiler cache) to all build jobs in the publish workflow to speed up release builds: - build_ubuntu_arm64 - build_ubuntu_x86_64 - build_alpine_arm64 - build_alpine_x86_64 - build_macos_arm64 - build_macos_x86_64 - build_windows_x86_64 Each job now has: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - mozilla-actions/sccache-action@v0.0.9 * perf(ci): enable Bazel caching for all workflows Update all Bazel-using workflows to use bazel-contrib/setup-bazel@0.18.0 with optimized caching configuration: - java.yml: Add disk-cache and repository-cache for test jobs - publish_java.yml: Add caching for release builds - release-please.yml: Upgrade from v0.14.0 to v0.18.0, enable disk-cache Caching configuration: - bazelisk-cache: true (cache Bazel downloads) - disk-cache: workflow-specific key (cache build outputs) - repository-cache: true (cache external dependencies) - cache-save: Only on main branch for PRs, always for releases * chore: re-enable mkdocs build in captainhook Re-enable the eng docs build (mkdocs) in both pre-commit and pre-push hooks. This was previously disabled with `echo 'disabled' ||` prefix. * perf(ci): enable Bazel cache saving for all runs Change cache-save from main-branch-only to always save, enabling cache reuse across multiple pushes to the same PR branch. This improves build times for iterative PR development where subsequent pushes can reuse artifacts from previous builds.
1 parent d892ce2 commit 3ae17e4

File tree

9 files changed

+828
-89
lines changed

9 files changed

+828
-89
lines changed

.github/labeler.yml

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,29 +149,81 @@ npm:
149149

150150
# Automatically add labels to any PR also based on branch naming conventions.
151151
build:
152-
- head-branch: [^.*/build/.*, build]
152+
- head-branch: ['^.*/build/.*', 'build']
153153

154154
chore:
155-
- head-branch: [^.*/chore/.*, chore]
155+
- head-branch: ['^.*/chore/.*', 'chore']
156156

157157
ci:
158-
- head-branch: [^.*/ci/.*, ci]
158+
- head-branch: ['^.*/ci/.*', 'ci']
159159

160160
feature:
161-
- head-branch: [^.*/feat/.*, feature]
161+
- head-branch: ['^.*/feat/.*', 'feature']
162162

163163
fix:
164-
- head-branch: [^.*/fix/.*, fix]
164+
- head-branch: ['^.*/fix/.*', 'fix']
165165

166166
perf:
167-
- head-branch: [^.*/perf/.*, perf]
167+
- head-branch: ['^.*/perf/.*', 'perf']
168168

169169
refactor:
170-
- head-branch: [^.*/refactor/.*, refactor]
170+
- head-branch: ['^.*/refactor/.*', 'refactor']
171171

172172
style:
173-
- head-branch: [^.*/style/.*, style]
173+
- head-branch: ['^.*/style/.*', 'style']
174174

175175
test:
176-
- head-branch: [^.*/test/.*, test]
176+
- head-branch: ['^.*/test/.*', 'test']
177+
178+
# ==============================================================================
179+
# RELEASE PLEASE LABELS
180+
# ==============================================================================
181+
# Automatically label release PRs created by release-please.
182+
# Branch pattern: release-please--<component>--<path>
183+
184+
release:
185+
- head-branch: ['^release-please--.*']
186+
187+
# Component-specific release labels
188+
release/dotprompt:
189+
- head-branch: ['^release-please--dotprompt.*']
190+
191+
release/dotpromptz:
192+
- head-branch: ['^release-please--dotpromptz--.*']
193+
194+
release/dotpromptz-handlebars:
195+
- head-branch: ['^release-please--dotpromptz-handlebars--.*']
196+
197+
release/dotprompt-go:
198+
- head-branch: ['^release-please--dotprompt-go.*']
199+
200+
release/dotprompt-rs:
201+
- head-branch: ['^release-please--dotprompt-rs.*']
202+
203+
release/dotprompt-java:
204+
- head-branch: ['^release-please--dotprompt-java.*']
205+
206+
release/vscode:
207+
- head-branch: ['^release-please--dotprompt-vscode.*']
208+
209+
release/vim:
210+
- head-branch: ['^release-please--dotprompt-vim.*']
211+
212+
release/emacs:
213+
- head-branch: ['^release-please--dotprompt-emacs.*']
214+
215+
release/jetbrains:
216+
- head-branch: ['^release-please--dotprompt-jetbrains.*']
217+
218+
release/monaco:
219+
- head-branch: ['^release-please--dotprompt-monaco.*']
220+
221+
release/codemirror:
222+
- head-branch: ['^release-please--dotprompt-codemirror.*']
223+
224+
release/treesitter:
225+
- head-branch: ['^release-please--tree-sitter-dotprompt.*']
226+
227+
release/promptly:
228+
- head-branch: ['^release-please--promptly.*']
177229

.github/workflows/bazel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ jobs:
5454
# - bazelisk-cache: Caches Bazel downloads based on .bazelversion
5555
# - disk-cache: Stores build outputs, shared across PRs
5656
# - repository-cache: Stores external dependencies
57-
# - cache-save: Only save cache on main branch to avoid PR pollution
57+
# - cache-save: Always save cache to enable reuse across PR pushes
5858
- name: Setup Bazel
5959
uses: bazel-contrib/setup-bazel@0.18.0
6060
with:
6161
bazelisk-cache: true
6262
disk-cache: ${{ github.workflow }}-java${{ matrix.java-version }}
6363
repository-cache: true
64-
cache-save: ${{ github.ref == 'refs/heads/main' }}
64+
cache-save: true
6565

6666
- name: Check if this is a release-please PR
6767
id: check-release-please

.github/workflows/java.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ jobs:
9292
distribution: 'temurin'
9393

9494
- name: Setup Bazel
95-
uses: bazelbuild/setup-bazelisk@v3
95+
uses: bazel-contrib/setup-bazel@0.18.0
96+
with:
97+
bazelisk-cache: true
98+
disk-cache: ${{ github.workflow }}-java${{ matrix.java-version }}
99+
repository-cache: true
100+
cache-save: true
96101

97102
- name: Run Tests
98103
run: |

.github/workflows/publish_java.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ jobs:
5050
distribution: 'temurin'
5151

5252
- name: Setup Bazel
53-
uses: bazelbuild/setup-bazelisk@v3
54-
53+
uses: bazel-contrib/setup-bazel@0.18.0
54+
with:
55+
bazelisk-cache: true
56+
disk-cache: ${{ github.workflow }}
57+
repository-cache: true
58+
# Always save cache for release builds
59+
cache-save: true
60+
5561
- name: Import GPG key
5662
id: import_gpg
5763
uses: crazy-max/ghaction-import-gpg@v6

0 commit comments

Comments
 (0)