Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: adds release workflow for automated draft releases #54

Merged
merged 6 commits into from
Aug 11, 2023

Conversation

dutterbutter
Copy link
Collaborator

@dutterbutter dutterbutter commented Aug 11, 2023

What 💻

  • Adds release.yaml to the CI
  • Adds push tag workflow trigger for check and test workflows
  • Updates ci deps for rust cache
  • Adds make command
  • Adds a Cross.toml file for release.yaml workflow

Why ✋

  • Automates the preparation of binaries for multiple targets and drafts a release.
  • When we push a tag (e.g. v0.0.1-alpha) it will trigger the test, checks, and release workflows
  • Outdated CI dep
  • make rust-<target> command added to makefile for ci convenience and readability
  • Toml file is used for cross configuration in the ci. See docs here: cross

Evidence 📷

The release will be presented as such 👇 :

release release2

Notes 📝

Specifics on the release workflow 👇

Overview: release.yaml

This PR introduces a new release pipeline aimed at automating the creation of GitHub releases, ensuring consistency and efficiency in our delivery process. The workflow is inspired by practices from reth and Lighthouse.

Release Workflow

  1. Extract version: The workflow extracts the version from the Git tag. The Git tag is being used to trigger the workflow.
  2. Build: A matrix build is executed to generate binaries for multiple architectures.
  3. Draft Release: A release draft is prepared with an automatically generated changelog and attached binaries.

First Run

On the first execution of this workflow, the "All Changes" section of the release draft will be empty. This behaviour occurs because the action fetches commits between tags. Since there will be no prior tag for the first run, it does not populate this section. However, for subsequent runs, this section will feature all commits up to the given tag. The first run we will have to do so manually by running git log main --oneline and adding the commits.

Draft Release

The workflow creates a draft release instead of a public one. This approach is intentional. It allows us to:

  • Add any additional commentary.
  • Ensure checks and test CI jobs pass successfully.
  • Prepare announcements or tweets related to the release prior to the release.
  • Ensure it works as intended, and all the changes intended are present.

Once the draft is reviewed and any required changes are made, we can finalize and create the release accordingly.

Note: The binaries links in the table will not resolve until the release is made. That is, when a release is in "draft" form on GitHub, it is given an untagged-... URL. So when the release is made it will be tagged with the corresponding tag.

Triggering the Release Pipeline

To trigger the release pipeline, you'll need to create and push a Git tag. Here are the commands:

# Create a tag
git tag -a v[VERSION_NUMBER] -m "Release v[VERSION_NUMBER]"

# Push the tag to the repository
git push origin v[VERSION_NUMBER]

Replace [VERSION_NUMBER] with the desired version number. This will trigger the check.yaml and test.yaml workflows, and release.yaml.

@dutterbutter dutterbutter added the needs review 👓 PR requires a review label Aug 11, 2023
.github/workflows/release.yml Show resolved Hide resolved
Makefile Show resolved Hide resolved
Copy link
Collaborator

@MexicanAce MexicanAce left a comment

Choose a reason for hiding this comment

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

LGTM

@dutterbutter dutterbutter merged commit 7051cda into main Aug 11, 2023
6 checks passed
@dutterbutter dutterbutter deleted the db/adds-release-action branch August 11, 2023 13:49
IAvecilla pushed a commit to lambdaclass/era-test-node that referenced this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review 👓 PR requires a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants