Skip to content

Commit cd5e40d

Browse files
committed
fix(release): make recovery lane publishable
1 parent 079959c commit cd5e40d

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
name: Publish to Hex
5252
runs-on: ubuntu-latest
5353
needs: release-please
54-
if: ${{ needs.release-please.outputs.release_created == 'true' }}
54+
if: ${{ github.event_name == 'workflow_dispatch' || needs.release-please.outputs.release_created == 'true' }}
5555
environment: hex-publish
5656
permissions:
5757
contents: read
@@ -65,6 +65,11 @@ jobs:
6565
elixir-version: "1.19.5"
6666
otp-version: "28"
6767

68+
- name: Install Hex and Rebar
69+
run: |
70+
mix local.hex --force
71+
mix local.rebar --force
72+
6873
- name: Restore Mix cache
6974
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
7075
with:

docs/maintainer-release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ If `workflow_dispatch` is used, treat it as recovery-only. It is not a normal pu
5353
- Restrict the environment to deployments from `main`.
5454
- Keep workflow permissions minimal and publish jobs pinned to immutable action SHAs.
5555
- Keep the authenticated dry-run inside the trusted workflow via `mix release.preflight`.
56+
- If a merged release needs to be replayed after a workflow failure, use `workflow_dispatch` with a recovery reason to rerun the same protected publish lane.
5657
- Record protected-environment evidence separately from repo-owned proof: deployment restrictions, bypass posture, and environment-secret placement all live in GitHub settings rather than in the repo.
5758

5859
## Release posture

test/lockspire/release_readiness_contract_test.exs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ defmodule Lockspire.ReleaseReadinessContractTest do
4040
assert release_workflow =~ "recovery_reason"
4141
assert release_workflow =~ "workflow_dispatch is recovery-only"
4242
assert release_workflow =~ "Release Please generated PRs are review-only"
43+
assert release_workflow =~ "github.event_name == 'workflow_dispatch'"
44+
assert release_workflow =~ "mix local.hex --force"
45+
assert release_workflow =~ "mix local.rebar --force"
4346

4447
assert release_workflow =~
4548
"Trusted proof starts only after merge in the protected hex-publish environment"
@@ -51,7 +54,7 @@ defmodule Lockspire.ReleaseReadinessContractTest do
5154
assert release_workflow =~ "run: mix hex.publish --yes"
5255

5356
assert release_workflow =~
54-
"if: ${{ needs.release-please.outputs.release_created == 'true' }}"
57+
"if: ${{ github.event_name == 'workflow_dispatch' || needs.release-please.outputs.release_created == 'true' }}"
5558

5659
refute release_workflow =~ "pull_request:"
5760
refute release_workflow =~ "package-name: lockspire"

0 commit comments

Comments
 (0)