feat: release with addresses on merge#38
Open
rubydusa wants to merge 2 commits into
Open
Conversation
Contributor
Author
Lets consumers enable testnet release-on-merge from a single workflow file by setting release-on-merge: true and adding 'closed' to their pull_request types, instead of maintaining a second wrapper for _release-testnet.yml. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Merged
4 tasks
Contributor
Author
|
refactored to address concern over inconvenience of having to add 2 workflow files on the consumer repo |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a “release on PR merge” capability to the Foundry CI/CD reusable workflows by introducing scripts and workflows that redeploy the merge commit to testnet and publish a GitHub Release containing deployed contract addresses.
Changes:
- Added
scripts/release/helpers to build a markdown release body from Forge broadcast output and to create a GitHub Release with configurable tag-collision behavior. - Introduced a new reusable workflow
_release-testnet.ymland extended_foundry-cicd.ymlwithrelease-on-mergeinputs and arelease-testnetjob. - Added bash-based tests for the new scripts and wired them into the repo CI workflow.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/release/build-release-body.sh |
Generates release notes markdown (banner + deployed contracts table + links). |
scripts/release/create-release.sh |
Creates/releases tags with collision policy and step-summary output. |
.github/workflows/_release-testnet.yml |
New reusable workflow to redeploy merge commit and publish a release. |
.github/workflows/_foundry-cicd.yml |
Adds release inputs/job and adjusts change-detection behavior for PR close events. |
tests/test-build-release-body.sh |
Tests for release body generation behavior and edge cases. |
tests/test-create-release.sh |
Tests for release collision policies and failure modes. |
.github/workflows/test.yml |
Runs the new bash tests in CI. |
README.md |
Documents new _release-testnet.yml workflow and _foundry-cicd.yml release options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+40
to
+45
| if echo "$VIEW_OUTPUT" | grep -qi "release not found\|not found"; then | ||
| EXISTS=0 | ||
| else | ||
| echo "::error::Failed to query release '$TAG' on $REPO:" | ||
| echo "$VIEW_OUTPUT" | ||
| exit 1 |
Comment on lines
+129
to
+145
| # Test 5: gh release view fails for a reason other than "not found" — surface error, do not create | ||
| ( | ||
| setup_test | ||
| export COLLISION_POLICY="replace" | ||
| export MOCK_GH_VIEW_EXIT=1 | ||
| export MOCK_GH_VIEW_OUTPUT="HTTP 401: Bad credentials" | ||
|
|
||
| if bash "$SCRIPT" > /dev/null 2>&1; then | ||
| echo "FAIL: should have exited non-zero on auth error" | ||
| exit 1 | ||
| fi | ||
| if grep -q "^release create " "$MOCK_GH_LOG"; then | ||
| echo "FAIL: must not create release after view error" | ||
| exit 1 | ||
| fi | ||
| echo "PASS: surfaces non-not-found view error" | ||
| ) || { FAILURES=$((FAILURES + 1)); } |
Comment on lines
+73
to
+79
| jobs: | ||
| release-testnet: | ||
| name: Deploy & Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP: Currently this will require consumer repos to add another wrapper workflow which complicates usage significantly.
Needs better way to automatically provide on_close triggered releases