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

Automate release preparation process #1710

Closed
wants to merge 4 commits into from

Conversation

ClaudiaComito
Copy link
Contributor

@ClaudiaComito ClaudiaComito commented Nov 5, 2024

Due Diligence

  • General:
  • Implementation:
    • unit tests: all split configurations tested
    • unit tests: multiple dtypes tested
    • benchmarks: created for new functionality
    • benchmarks: performance improved or maintained
    • documentation updated where needed

Description

Summary

This PR introduces a new GitHub Actions workflow named "Prep Heat Release". The workflow is designed to automate the process of preparing a release for the Heat project.

Motivation

The goal of this workflow is to streamline the release preparation process by automating version extraction, branch creation, and version bumping. This reduces manual effort and minimizes the risk of human error.

Workflow Details

The workflow is triggered when an issue is opened with the label release-prep. A dedicated issue template has been added to the repo.

Impact

These changes will automate the release preparation process. It will create new release branches if needed, and update version numbers automatically based on the issue title. It will create a PR where further (manual) work can be collected.

The resulting PR looks like this.

Issue/s resolved: #1709

Changes proposed:

  • Added a new issue template for release preparation in .github/ISSUE_TEMPLATE/release_prep.md to guide users through the process of triggering the release preparation workflow.
  • Created a new GitHub Actions workflow in .github/workflows/release-prep.yaml to automate the release preparation process, including extracting version information, creating release branches, updating version numbers, and creating pull requests.
  • Updated RELEASE.md to reflect the new automated release preparation process, including instructions on how to trigger the workflow, update version numbers, and publish releases. [1] [2] [3]
  • Added placeholders for additional release methods such as easybuild, spack, and Docker in RELEASE.md.

Type of change

Automation and docs update

Memory requirements

Performance

Does this change modify the behaviour of other functions? If so, which?

no

@ClaudiaComito ClaudiaComito added this to the 1.5.1 milestone Nov 5, 2024
Copy link
Member

@JuanPedroGHM JuanPedroGHM left a comment

Choose a reason for hiding this comment

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

Missing:

  • Name adjustment to new branching style.

Ideas:

  • To PR's could be created, the one that will be merged into release, and the one that will be merged into main. Both should follow the newly created branch "pre-release/x.y.z"


on:
issues:
types: [opened]
Copy link
Member

Choose a reason for hiding this comment

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

I think using a workflow_dispatch trigger might be a better option.

  1. No need to create an issue. Workflow can be triggered manually with a button.
  2. Version number can be provided as input, no need to parse it from the title.
  3. No unnecessary action triggers every time an issue is created.

More on this: https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow

if: steps.extract-version.outputs.micro == 0
run: |
git checkout -b release/${{ steps.extract-version.outputs.major }}.${{ steps.extract-version.outputs.minor }}.x
git push origin release/${{ steps.extract-version.outputs.major }}.${{ steps.extract-version.outputs.minor }}.x
Copy link
Member

Choose a reason for hiding this comment

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

In keeping with git-flow style branches, I would call this "pre-release/x.y.z". Based on this link, "main" is would be "release" in our case, "develop" is "main", and we could name "release/x.y.z" as "pre-release/x.y.z".

echo "minor=$minor" >> $GITHUB_OUTPUT
echo "micro=$micro" >> $GITHUB_OUTPUT
- name: Delete Existing Version Update Branch
run: git push --delete origin ${{ env.working_branch }} || true
Copy link
Member

Choose a reason for hiding this comment

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

When is this branch created, or where does it come from?

uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
base: release/${{ steps.extract-version.outputs.major }}.${{ steps.extract-version.outputs.minor }}.x
branch: ${{ env.working_branch }}
Copy link
Member

Choose a reason for hiding this comment

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

The base branch should be "release", and the branch should be our newly created branch, right? "pre-release/x.y.z"

- name: Create Release Branch
if: steps.extract-version.outputs.micro == 0
run: |
git checkout -b release/${{ steps.extract-version.outputs.major }}.${{ steps.extract-version.outputs.minor }}.x
Copy link
Member

Choose a reason for hiding this comment

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

I would add an extra git checkout main; git pull to make sure we are branching of the most recent version of main.

@ClaudiaComito
Copy link
Contributor Author

Closing as this will be addressed in #1678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Automate release preparation
2 participants