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

Create a release-commit action #97

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JamyGolden
Copy link
Member

To create a release, currently a few things should be run before running the "Release" github action (which builds the tinty binaries and publishes the latest version to crates.io). The things that need to be done is:

  • Bump Cargo.toml version to a minor or patch version. minor if there are new additions or breaking changes and patch if it's solely a bug fix
  • Cargo.lock should be automatically updated once Cargo.toml version is bumped
  • CHANGELOG.md should rename ## Unreleased to ## [x.x.x] - yyyy-mm-dd and a link added at the bottom of the file to link the diff of [x.x.x] with the previous version
  • Update THIRD-PARTY-LICENSES.md

I usually do this manually but I've made mistakes before and if other people join as maintainers, it's best to automate this process, so that's what this PR does.

I've tested ./scripts/create_release_changes (bash ./scripts/create_release_changes minor for example) and it works, but actions are a bit annoying to test so I'm not 100% sure it works. Hopefully something gets caught in the PR, otherwise I'll test it once it's merged and fix anything afterwards.

@JamyGolden JamyGolden requested a review from bezhermoso January 18, 2025 19:36
@JamyGolden JamyGolden requested a review from a team as a code owner January 18, 2025 19:36
@JamyGolden JamyGolden force-pushed the jamy/feature/release-commit branch from 3eaed67 to ec88056 Compare January 18, 2025 19:56
This should be created before the "release" github action is run
@JamyGolden JamyGolden force-pushed the jamy/feature/release-commit branch from ec88056 to ce94853 Compare January 18, 2025 20:03
- name: Ensure this release doesn't already exist
run: |
if git log --grep="Release ${{ steps.cargo_version.outputs.value }}" --quiet; then
Copy link
Member

Choose a reason for hiding this comment

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

Is this still necessary if we're checking for an existing tag?

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 this will cause a false-positive in the event the release got reverted for whatever reason.

If we're trying to determine is whether HEAD is already released, perhaps this will do:

git tag --contains <SHA1>

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove from here because the tag is already checked in the script file. The tags are important though since they are what the changelogs are linking to. The release action tags the commit before it does a binary build. It is possible the binary build fails in some strange case, then we have to manually delete the tag, fix the issue and do a new release. Not necessarily the best way of doing it but it's how it is set up atm. Usually the build doesn't fail if the tests pass though.

scripts/create_release_changes Outdated Show resolved Hide resolved
exit 1
fi

local current_date=$(date +"%Y-%m-%d")
Copy link
Member

Choose a reason for hiding this comment

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

Might help to set TZ=UTC or whatever to explicitly pin a timezone to avoid any surprises.

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