Skip to content

feat: release with addresses on merge#38

Open
rubydusa wants to merge 2 commits into
mainfrom
Rubydusa/address-release-on-merge
Open

feat: release with addresses on merge#38
rubydusa wants to merge 2 commits into
mainfrom
Rubydusa/address-release-on-merge

Conversation

@rubydusa
Copy link
Copy Markdown
Contributor

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

@rubydusa
Copy link
Copy Markdown
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]>
@rubydusa
Copy link
Copy Markdown
Contributor Author

refactored to address concern over inconvenience of having to add 2 workflow files on the consumer repo
https://github.com/BreadchainCoop/etherform-playground/releases/tag/testnet-pr-11
proof of this working

@rubydusa rubydusa marked this pull request as ready for review April 30, 2026 16:46
@RonTuretzky RonTuretzky requested a review from Copilot April 30, 2026 16:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml and extended _foundry-cicd.yml with release-on-merge inputs and a release-testnet job.
  • 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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants