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

New release strategy #82

Merged
merged 4 commits into from
May 22, 2023
Merged

New release strategy #82

merged 4 commits into from
May 22, 2023

Conversation

franciscodr
Copy link
Contributor

This pull request proposes a new release strategy for the library based on a semantic versioning approach.

The version of the library will be one of these four stages: alpha, beta, rc, and final

Every push to the main branch will increase the stage number of the version by one, except for final versions (to avoid unexpected releases of final versions). Some examples of this strategy:

  • 0.0.1-alpha.1 -> 0.0.1-alpha.2
  • 0.0.1-beta.4 -> 0.0.1-alpha.5
  • 0.0.1-rc.2 -> 0.0.1-alpha.3
  • 0.0.1 -> it remains unchanged

Creating the tag for this new version will trigger a GitHub Actions workflow to publish the artifacts in Sonatype.

Create version tags manually

When we want to change the stage of the version or the version itself, we will have to run the Create version tag manually workflow. This workflow has several options depending on what we are aiming for.

Create a new version

If the current version is final, and we want to start a new development cycle, we have three different choices:

  • alpha-major: 0.0.1 -> 1.0.0-alpha.1
  • alpha-minor: 0.0.1 -> 0.1.0-alpha.1
  • alpha-patch: 0.0.1 -> 0.0.2-alpha.1

Change the stage of the current version

If we want to change the stage of the current version, there are also three different options:

  • beta: 0.0.1-alpha.3 -> 0.0.1-beta.1
  • rc: 0.0.1-alpha.2 -> 0.0.1-rc.1
  • final: 0.0.1-alpha.2 -> 0.0.1

@franciscodr
Copy link
Contributor Author

@xebia-functional/team-ai Ready for review

Comment on lines +3 to +10
if [[ $1 == alpha-* ]]
then
echo "stage=alpha" >> "$GITHUB_OUTPUT"
echo "scope=$(echo "$1" | sed 's/alpha-\(.*\)/\1/')" >> "$GITHUB_OUTPUT"
else
echo "stage=$1" >> "$GITHUB_OUTPUT"
echo "scope=auto" >> "$GITHUB_OUTPUT"
fi
Copy link
Contributor

@nomisRev nomisRev May 22, 2023

Choose a reason for hiding this comment

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

Nit: is there any way to do this in Gradle? 🤔 We could pass ${{ github.event.inputs.stage }} as an Gradle property to the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, yes. I tried it, but I need to get more familiar with Gradle to create custom tasks

Copy link
Contributor

Choose a reason for hiding this comment

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

We can take care of it later. It's a bit confusing how to create tasks, sadly it's a lot more complex than just registering a Kotlin function with a Gradle task name 😭

Copy link
Contributor

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

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

Thank you @franciscodr! 🙌
Looks good to me, just a couple of nits but nothing critical, or blocking ☺️

@franciscodr franciscodr merged commit 949402a into main May 22, 2023
@franciscodr franciscodr deleted the release-strategy branch May 22, 2023 09:53
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