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

Change release GH actions to create and release from release branch #326

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

bidetofevil
Copy link
Collaborator

@bidetofevil bidetofevil commented Jan 29, 2024

Goal

Create a release branch to make any version-specific modifications on and make the release from there. The version number of the SDK will incremented when the release branch is cut, and commits after that will be de facto in the next release. The Swazzler will be updated in the pre-release workflow as it does before.

If there are additional changes that need to go into the release branch, they can be done first in master, then cherrypicked into the release branch.

For hotfixes, the same cherrypicking process will be done, but we will need to add additional GH Actions to ensure to automate the release.

Copy link
Collaborator Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fa834f4) 77.34% compared to head (9dee65e) 77.38%.
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #326      +/-   ##
==========================================
+ Coverage   77.34%   77.38%   +0.04%     
==========================================
  Files         336      336              
  Lines        9990     9986       -4     
  Branches     1462     1464       +2     
==========================================
+ Hits         7727     7728       +1     
+ Misses       1680     1675       -5     
  Partials      583      583              

see 10 files with indirect coverage changes

@bidetofevil bidetofevil marked this pull request as ready for review January 29, 2024 23:55
@bidetofevil bidetofevil requested a review from a team as a code owner January 29, 2024 23:55
Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

LGTM

git push
./gradlew clean publishReleasePublicationToSonatype closeSonatypeStagingRepository -Dorg.gradle.parallel=false --stacktrace

- name: Set next SDK version
Copy link
Collaborator

Choose a reason for hiding this comment

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

we shouldn't be setting the next version in pre-release-workflow. At least that's how I thought it.

pre-release-workflow will:

  • create the staging repository in nexus
  • upload the artefacts to it
  • close repositories

at this stage, we are able to perform smoke testing. That is why it's called pre-release.

It is important that we do not update gradle.properties with next-version-SNAPSHOT in this step, because we need the actual "pre-released" version for the next workflow (release.yaml)

In release workflow we will:

  • find the already created staging repository (this is why we don't need to update gradle.properties in previous step)
  • make the actual release from sonatype to maven central

does it make sense? i wasn't able to test the full flow, but it should be working.

If so, we should make the same changes to swazzler

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So all the changes should be done to the release branch at release/version, so the release stage should be referring to that and not master.

The goal here is to take a snapshot of master and move it to another branch so that master can move along, assuming that everything after that goes into master is part of the next release.

If there is something wrong in the release branch, we can fix it in master, and cherrypick the change and generate and test another release candidate. As long as we can do that in the release branch without needing to increment the patch version, we should be good.

Copy link
Collaborator

@cesarmax22 cesarmax22 left a comment

Choose a reason for hiding this comment

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

left a comment

uses: actions/checkout@v3
with:
run: |
git checkout -b release/${{ github.event.inputs.version_to_release }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cesarmax22 this is where I'm creating the release branch and at that point, everything should be running on that and not modifying master.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to change this so the branch name doesn't have the patch version - will update in a bit after we talk this through.

@@ -83,12 +88,20 @@ jobs:

- name: Gradlew Pre-Release
run: |
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.current_version }}#" gradle.properties
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.version_to_release }}#" gradle.properties
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is done on release/<version>

@@ -100,7 +113,7 @@ jobs:
- name: Swazzler Release
run: |
cd ./embrace-swazzler3
./gradlew clean release -Dorg.gradle.parallel=false -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ github.event.inputs.current_version }} -Prelease.newVersion=${{ github.event.inputs.next_version }}-SNAPSHOT --stacktrace
./gradlew clean release -Dorg.gradle.parallel=false -Prelease.useAutomaticVersion=true -Prelease.pushReleaseVersionBranch=release/${{ github.event.inputs.version_to_release }} -Prelease.releaseVersion=${{ github.event.inputs.version_to_release }} -Prelease.newVersion=${{ github.event.inputs.next_version }}-SNAPSHOT --stacktrace
Copy link
Collaborator Author

@bidetofevil bidetofevil Jan 30, 2024

Choose a reason for hiding this comment

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

This is where I modified the command to create a release branch in Swazzler. I followed the docs for the plugin, but I don't know if it actually works, so we'll have to do by trying it out. This is the part where I'm most unsure about...

@@ -28,6 +31,7 @@ jobs:
- name: Checkout Branch
uses: actions/checkout@v3
with:
ref: release/${{ github.event.inputs.version_to_release }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The release is from the release branch, so master is not involved, which is why I could move the version there even before we actually release.

@bidetofevil bidetofevil merged commit d24effb into master Jan 30, 2024
6 of 7 checks passed
@bidetofevil bidetofevil deleted the hho/release-actions branch January 30, 2024 18:38
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.

None yet

3 participants