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

feat: hotfix workflow #19

Merged
merged 8 commits into from
Jun 18, 2024
Merged

feat: hotfix workflow #19

merged 8 commits into from
Jun 18, 2024

Conversation

tchataigner
Copy link
Contributor

@tchataigner tchataigner commented Jun 14, 2024

This PR udpates the workflow files for release to also be used for a hotfix flow. The flow would work as follow:

  1. Use the bump-version-PR flow to create a new branch a PR to the desired release branch
  2. Use the generated hotfix branch to implement the needed fixes
  3. Squash merge the PR when ready, a tag with the hotfix version will be automatically generated at the tip of the release branch
  4. Cherry-pick or merge via PR the changes from the release branch to the dev branch

Part of #13

@tchataigner tchataigner marked this pull request as ready for review June 14, 2024 13:55
.github/workflows/bump-version-PR.yml Show resolved Hide resolved
.github/workflows/bump-version-PR.yml Outdated Show resolved Hide resolved
.github/workflows/bump-version-PR.yml Show resolved Hide resolved
title: "${{ inputs.type == 'release' && 'Release' || 'Hotfix' }} ${{ inputs.version }}"
branch: "${{ inputs.type }}/${{ inputs.version }}"
commit-message: "${{ inputs.type == 'release' && 'feat' || 'fix' }}: bump version to ${{ inputs.version }}"
Copy link
Member

Choose a reason for hiding this comment

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

Looking at a few popular Rust crates like tokio and clap, the idiomatic prefix seems to be chore: regardless of whether it's a bug fix or standard release. If we want to go this route, we should specify release somewhere in the message after the commit, e.g. chore: release ${{ inputs.version }}

.github/workflows/bump-version-PR.yml Outdated Show resolved Hide resolved
tag_name: ${{ steps.get-version.outputs.version }}
target_commitish: ${{ startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.head.ref || github.event.pull_request.base.ref }}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be ${{ github.event.pull_request.base.ref }} in all cases? That is, if the base of the PR is dev, then the release is created from dev, and if the base is release/, then the release is created from release/.

@tchataigner tchataigner changed the title feat: bug feat: hotfix workflow Jun 15, 2024
@tchataigner tchataigner force-pushed the feature/bugfix-workflow branch from fc401c7 to 4837ee4 Compare June 17, 2024 14:51
Copy link
Member

@samuelburnham samuelburnham left a comment

Choose a reason for hiding this comment

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

Approved pending some minor fixes in #26

tchataigner and others added 8 commits June 18, 2024 17:23
Signed-off-by: Thomas Chataigner <[email protected]>
Signed-off-by: Thomas Chataigner <[email protected]>
Signed-off-by: Thomas Chataigner <[email protected]>
Signed-off-by: Thomas Chataigner <[email protected]>
Signed-off-by: Thomas Chataigner <[email protected]>
Signed-off-by: Thomas Chataigner <[email protected]>
* ci: Update release workflow

* fix: Enforce `major.minor` version only for initial release

* fix: Use full `major.minor.patch` for `Cargo.toml` and tag
@tchataigner tchataigner force-pushed the feature/bugfix-workflow branch from 8601da5 to 522b39b Compare June 18, 2024 15:24
@tchataigner tchataigner enabled auto-merge (squash) June 18, 2024 15:29
@tchataigner tchataigner merged commit 9631250 into dev Jun 18, 2024
3 checks passed
@tchataigner tchataigner deleted the feature/bugfix-workflow branch June 18, 2024 15:39
storojs72 pushed a commit that referenced this pull request Jun 18, 2024
* ci: release ci

Signed-off-by: Thomas Chataigner <[email protected]>

* ci: add release creation

Signed-off-by: Thomas Chataigner <[email protected]>

* ci: fix release files

Signed-off-by: Thomas Chataigner <[email protected]>

* ci: update based on review

Signed-off-by: Thomas Chataigner <[email protected]>

* ci: dry files & hotfix flow

Signed-off-by: Thomas Chataigner <[email protected]>

* Apply suggestions from code review

Co-authored-by: Samuel Burnham <[email protected]>

* ci: base for PR

Signed-off-by: Thomas Chataigner <[email protected]>

* ci: Update release workflow (#26)

* ci: Update release workflow

* fix: Enforce `major.minor` version only for initial release

* fix: Use full `major.minor.patch` for `Cargo.toml` and tag

---------

Signed-off-by: Thomas Chataigner <[email protected]>
Co-authored-by: Samuel Burnham <[email protected]>
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