Skip to content

Commit 89654e1

Browse files
committed
chore(release): bump crate to v1.0.6
1 parent e59b8e3 commit 89654e1

File tree

7 files changed

+141
-13
lines changed

7 files changed

+141
-13
lines changed

.github/workflows/homebrew-tap-pr.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Homebrew Tap PR
22

33
on:
4-
release:
5-
types:
6-
- published
74
workflow_dispatch:
85
inputs:
96
tag:
@@ -12,7 +9,7 @@ on:
129
type: string
1310

1411
concurrency:
15-
group: homebrew-tap-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.release.tag_name || inputs.tag || github.run_id }}
12+
group: homebrew-tap-${{ github.workflow }}-${{ inputs.tag || github.run_id }}
1613
cancel-in-progress: false
1714

1815
jobs:
@@ -34,14 +31,10 @@ jobs:
3431
id: tag
3532
shell: bash
3633
run: |
37-
if [[ "${{ github.event_name }}" == "release" ]]; then
38-
TAG="${{ github.event.release.tag_name }}"
39-
else
40-
TAG="${{ inputs.tag }}"
41-
fi
34+
TAG="${{ inputs.tag }}"
4235
4336
if [[ -z "$TAG" ]]; then
44-
echo "ERROR: missing release tag"
37+
echo "ERROR: missing release tag input (workflow_dispatch input: tag)"
4538
exit 1
4639
fi
4740

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,57 @@ jobs:
179179
name: ${{ needs.meta.outputs.tag }}
180180
body: ${{ steps.git-cliff.outputs.content }}
181181

182+
dispatch-homebrew-tap-pr:
183+
name: Dispatch Homebrew Tap PR workflow
184+
needs: [meta, github-release]
185+
runs-on: ubuntu-latest
186+
continue-on-error: true
187+
permissions:
188+
actions: write
189+
contents: read
190+
steps:
191+
- name: Dispatch Homebrew Tap PR workflow
192+
id: dispatch
193+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
194+
with:
195+
github-token: ${{ secrets.GITHUB_TOKEN }}
196+
script: |
197+
const tag = '${{ needs.meta.outputs.tag }}';
198+
const workflowId = 'homebrew-tap-pr.yml';
199+
const ref = context.payload.repository.default_branch;
200+
const { owner, repo } = context.repo;
201+
202+
core.info(`Dispatching ${workflowId} for tag ${tag} on ref ${ref}`);
203+
204+
try {
205+
await github.rest.actions.createWorkflowDispatch({
206+
owner,
207+
repo,
208+
workflow_id: workflowId,
209+
ref,
210+
inputs: { tag },
211+
});
212+
core.info(`Dispatched ${workflowId} with tag=${tag}`);
213+
} catch (error) {
214+
core.error(
215+
`Failed to dispatch ${workflowId} for tag ${tag}: ${error.message}`
216+
);
217+
core.error(
218+
`Manual fallback: gh workflow run ${workflowId} -R ${owner}/${repo} -f tag=${tag}`
219+
);
220+
core.error(
221+
"See RELEASING.md -> Homebrew tap sync flow (example) for dispatch fallback guidance."
222+
);
223+
core.setFailed(error.message);
224+
}
225+
226+
- name: Dispatch fallback guidance
227+
if: ${{ failure() }}
228+
run: |
229+
echo "::warning::Homebrew tap workflow dispatch failed. Crate release remains non-blocking."
230+
echo "::warning::Manual fallback: gh workflow run homebrew-tap-pr.yml -R ${{ github.repository }} -f tag=${{ needs.meta.outputs.tag }}"
231+
echo "::warning::See RELEASING.md -> Homebrew tap sync flow (example)."
232+
182233
build:
183234
name: Build & Upload Binaries
184235
needs: [meta, github-release]

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### Security
2121

22+
## [1.0.6] - 2026-02-16
23+
24+
### Added
25+
26+
### Changed
27+
28+
- Switched Homebrew tap automation from `release.published` listening to explicit dispatch from the release workflow.
29+
- Added a non-blocking release job that dispatches `homebrew-tap-pr.yml` and emits manual fallback guidance on dispatch failure.
30+
- Updated release documentation and ADRs for the explicit dispatch trigger contract.
31+
32+
### Deprecated
33+
34+
### Removed
35+
36+
### Fixed
37+
38+
### Security
39+
2240
## [1.0.5] - 2026-02-16
2341

2442
### Added

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "envgen"
3-
version = "1.0.5"
3+
version = "1.0.6"
44
edition = "2021"
55
description = "Generate and validate .env files from one spec - self-documenting config, consistent across environments, secrets stay out of git."
66
readme = "README.md"

RELEASING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,12 @@ Pushing `schema-v*.*.*` tags does not trigger crates.io publish.
291291

292292
Automation equivalent:
293293

294-
- `.github/workflows/homebrew-tap-pr.yml` runs on `release.published` and can be retried with `workflow_dispatch`.
294+
- Tag push triggers `.github/workflows/release.yml`.
295+
- `release.yml` job `dispatch-homebrew-tap-pr` explicitly dispatches
296+
`.github/workflows/homebrew-tap-pr.yml` using `workflow_dispatch` with
297+
`tag=vX.Y.Z`.
298+
- You can manually retry the tap workflow with:
299+
- `gh workflow run homebrew-tap-pr.yml -R smorinlabs/envgen -f tag=vX.Y.Z`
295300

296301
## Reset HOMEBREW_TAP_GITHUB_TOKEN (step-by-step)
297302

@@ -346,6 +351,11 @@ Docs:
346351
- Partial update on bump failure:
347352
- A failed bump can leave version/changelog edits before later steps complete.
348353
- Recovery: run `make sync-lockfile` and retry the bump after fixing the reported error.
354+
- Homebrew tap workflow dispatch failure:
355+
- Symptom: `release.yml` job `Dispatch Homebrew Tap PR workflow` fails.
356+
- Impact: crate release remains successful (non-blocking), but tap sync does not start automatically.
357+
- Fix: check the dispatch job logs and repo workflow permissions (`actions: write`), then run:
358+
- `gh workflow run homebrew-tap-pr.yml -R smorinlabs/envgen -f tag=vX.Y.Z`
349359
- Homebrew tap token auth/permission errors:
350360
- Symptom: workflow step `Validate tap token permissions` fails with `::error::` output.
351361
- Fix: follow `Reset HOMEBREW_TAP_GITHUB_TOKEN (step-by-step)` in this document.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 0015: Explicitly dispatch Homebrew tap PR workflow from release pipeline
2+
Date: 2026-02-16
3+
Status: Accepted
4+
5+
## Context
6+
7+
`envgen` publishes GitHub releases in `.github/workflows/release.yml` using
8+
`softprops/action-gh-release` and `secrets.GITHUB_TOKEN`.
9+
10+
The Homebrew tap workflow `.github/workflows/homebrew-tap-pr.yml` previously
11+
listened to `release.published` events. In practice, downstream workflow
12+
triggering from release events generated by `github-actions[bot]` was not
13+
reliable for this pipeline.
14+
15+
Observed outcome: crate release completed, but Homebrew tap sync did not start
16+
unless manually dispatched.
17+
18+
## Decision
19+
20+
Dispatch `.github/workflows/homebrew-tap-pr.yml` explicitly from
21+
`.github/workflows/release.yml` after the `github-release` job succeeds.
22+
23+
Implementation details:
24+
25+
- Add `dispatch-homebrew-tap-pr` job in `release.yml`.
26+
- Use `actions/github-script` and
27+
`github.rest.actions.createWorkflowDispatch(...)`.
28+
- Pass input `tag=${{ needs.meta.outputs.tag }}`.
29+
- Keep the dispatch job non-blocking via `continue-on-error: true`.
30+
- Keep manual fallback path documented:
31+
`gh workflow run homebrew-tap-pr.yml -R smorinlabs/envgen -f tag=vX.Y.Z`.
32+
33+
## Consequences
34+
35+
- Homebrew tap sync trigger is deterministic and auditable from the release run.
36+
- Failures in tap workflow dispatch do not block crate release completion.
37+
- Operational debugging is simpler: a single release run contains dispatch
38+
success/failure signals.
39+
- `homebrew-tap-pr.yml` trigger contract is now `workflow_dispatch` only.
40+
41+
## Alternatives considered
42+
43+
1. Keep `release.published` listener in `homebrew-tap-pr.yml`.
44+
- Rejected: non-deterministic auto-trigger behavior in this setup.
45+
2. Chain with `workflow_run` from `release.yml`.
46+
- Rejected: less direct control over input payload (`tag`) and dispatch
47+
error handling/logging.
48+
3. Publish release with a PAT instead of `GITHUB_TOKEN`.
49+
- Rejected: introduces additional credential management and wider token
50+
scope for a problem solved by explicit workflow dispatch.
51+
52+
## References/links
53+
54+
- `/Users/stevemorin/c/envgen/.github/workflows/release.yml`
55+
- `/Users/stevemorin/c/envgen/.github/workflows/homebrew-tap-pr.yml`
56+
- `/Users/stevemorin/c/envgen/RELEASING.md`

0 commit comments

Comments
 (0)