-
Notifications
You must be signed in to change notification settings - Fork 3
[AE-181] Add check-release-version.yml
workflow
#28
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
Conversation
Memory usage change @ 64d2ef0
Click for full report table
Click for full report CSV
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will make following a specific tag format mandatory (the tag name must match the version
value exactly. I think standardizing the tag format is a good thing, but it is only reasonable to expect the project maintainers to comply if the required format is documented.
This could be included in a formal release procedure, which would include instructions to bump the version
value in library.properties
before tagging. You can see an example of such a document here:
https://github.com/arduino/arduino-ide/blob/main/docs/internal/release-procedure.md
A library release procedure would not be as complex as is required for Arduino IDE, but you get the idea. I find it very useful to have a document like this that I can follow to ensure a 100% successful release even in less complex projects.
Note that the last tag pushed to this repository was named v.1.1.0
, which would have been detected as a mismatch even if the version
value in library.properties
had been correct at the time of the release.
# Step 1: Checkout the repository code | ||
- name: Checkout code | ||
uses: actions/checkout@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repository should be checked out at the tagged version. Even though it is common to tag at the revision at the current tip of the default branch, there is no requirement for doing so.
It can be useful to tag a prior revision in the case where a release is needed, but some of the recent work is not yet ready for release. The workflow should accommodate that possibility.
This can be done by moving the checkout step to after the step that gets the tag, then passing the tag to the ref
input of the actions/checkout
action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you propose that tagging is performed manually by the maintainers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not propose. That is simply the current practice in Arduino's library repositories and no change to that practice had been proposed at the time I wrote this.
It was only later that an alternative procedure, by which the tags and GitHub Releases would be created automatically was proposed (#28 (comment)).
echo "::set-output name=version::$version" | ||
|
||
# Step 4: Delete the release if the versions don't match | ||
- name: Delete release if failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the idea is that you will correct library.properties
and then push the deleted tag again?
Moving a tag after it was pushed to a public repository is considered a bad practice that can cause problems:
https://git-scm.com/docs/git-tag#_on_re_tagging
I know that Arduino developers already sometimes re-tag, but formalizing the bad practice in a workflow that is bound to propagate to many projects is another story.
The correct approach is to push a new tag with a correct library.properties
(e.g., if the 1.1.0
tag was bad, then bump the version
field to 1.1.1
and then push a 1.1.1
tag).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that for the core, tagged versions (but not released) are avaliable via the IDE. Hence the reason the tag must be deleted, although I agree this is not an ideal approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tag dependant behaviour is mentioned here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tagged versions (but not released) are avaliable via the IDE. Hence the reason the tag must be deleted, although I agree this is not an ideal approach.
Note the second step described at the link you shared:
- checks whether those tags meet the requirements for addition to the index
The Arduino Library Manager engine will reject any tag where the value of the version
field of library.properties
at the tag is the same as a previously indexed release of the library.
So this means there is no need to delete tags for the sake of Library Manager. The tags where the library maintainer forgot to update the library.properties
file before tagging will simply be ignored by the engine.
Really good feedback @per1234 ! About the documentation part, we're working on a guideline on library development that comes with a chapter about release. @aliphys Can you take a look at Per's suggestions? I agree with his comments. |
I was thinking a bit and maybe it might be better to check the tags and not the releases because eventually the releases are based on the tags. So on each push we could retrieve the "latest" tag (need to figure out how) and then check the version in the library.properties file for the commit which was tagged with said version. If there is a mismatch, fail the build. |
I think the idea of a GitHub Actions workflow that is manually triggered to take all actions required to produce a perfect release is a good idea. I would recommend starting from a single workflow and then only split it into multiple workflows if you find that there is a significant amount of completely divergent code for each release type and overhead for switching between them. You can use the inputs feature of the https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#providing-inputs So you could add a radio button for which release type to make and an optional text field for specifying a commit hash for the tag (in case some of the staged work is not yet ready for release). That would allow a single workflow to be used for any type of release.
Definitely. It is common for maintainers to push a tag without ever creating a GitHub release to go with it. The Library Manager engine works exclusively from tags, so it will attempt to index a new tag even if the maintainer didn't create a GitHub release for the tag.
GitHub Actions provides it via |
Co-authored-by: per1234 <[email protected]>
Memory usage change @ 748693f
Click for full report table
Click for full report CSV
|
I will close this PR for the following reasons:
An alternative solution is to check to see if the |
This PR adds a new GitHub workflow to check the releases:
library.properties
and the release have different version numbers