-
Notifications
You must be signed in to change notification settings - Fork 0
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
GitHub action #21
GitHub action #21
Conversation
An action using the GITHUB_TOKEN cannot trigger another workflow. So to create a new release after a version bump, we simply run the release in the same workflow. See https://github.com/orgs/community/discussions/27028#discussioncomment-3254360
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 is so awesome! 🤩
Two nitpicky points, but feel free to merge.
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "/tmp/artifacts/release/*" | ||
tag: ${{ needs.bump-version.outputs.new_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.
It would be nice, if the release description would contain the corresponding PR description.
Currently, it's the version bump commit message 🙈
I imagine this could work:
- save the merge commit message into a tmp file (must be an early github action step, before version bump commit)
- pass this file to the
ncipollo/release-action
action asbodyFile
Thanks for the review and nice idea with the release body, let me look into that. A couple of other points that came to my mind:
|
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.
Sorry, I found a bug:
The latest release v0.1.1 contains the v0.1.0 package 😢
https://github.com/KIT-MRT/util_caching/releases/tag/v0.1.1
Good point!
Well, a header-only release is architecture independent – that's one of it's beauties.
Right. |
2104b3c
to
148b9d1
Compare
Co-authored-by: Piotr Spieker <[email protected]>
497f272
to
93676b7
Compare
9e7d84b
to
45d3b44
Compare
Ok @orzechow, this one is ready for another review. I did merge a dummy change again to test the workflow. This successfully created a new release like we want it to.
Done in b7d01be
Very good point, did not think that through 😅
Changed the default bump to #minor in c1486df
Done in 93676b7. We should be aware that this is vulnerable to script injections but I figured that we would probably notice malicious code in the PR description.
Good catch! This happened because the docker build-push-action will use the repository state that caused the workflow, so changes inside the workflow are not considered. This means that the deb package did contain all the changes of the new version except the bumped I fixed it by explicitly checking out the tag we created in the first job in 5adc18d and by setting the docker context to |
Since the PR description will now be the release description too, I updated the original description of the PR to be a little more concise and highlight the contributions of the PR. |
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.
Ok @orzechow, this one is ready for another review.
Beautiful, thanks a lot! 👏
Two suggestions, feel free to merge after considering these.
It would be nice, if the release description would contain the corresponding PR description.
Done in 93676b7. We should be aware that this is vulnerable to script injections but I figured that we would probably notice malicious code in the PR description.
Awesome, the test release v0.2.0 worked out great!
Conserning the vulnerability, I agree that we would probably notice such code.
But, I think we can avoid it altogether, see my code suggestions.
Sorry, I found a bug:
The latest release v0.1.1 contains the v0.1.0 package 😢Good catch! This happened because the docker build-push-action will use the repository state that caused the workflow, so changes inside the workflow are not considered. This means that the deb package did contain all the changes of the new version except the bumped
version
file which consequently lead to the wrong name of the package.I fixed it by explicitly checking out the tag we created in the first job in 5adc18d and by setting the docker context to
.
in 45d3b44. See here for reference on why this is necessary.
Nice and clean solution! 👍
README.md
Outdated
Download the latest `.deb` package from the [releases page](https://github.com/KIT-MRT/util_caching/releases) and install it with `dpkg`: | ||
|
||
```bash | ||
sudo dpkg -i util-caching*.deb |
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.
Optional:
We could think of removing the version from the deb
file name (by changing CPACK_DEBIAN_FILE_NAME
).
That would enable a direct link here:
Download the latest `.deb` package from the [releases page](https://github.com/KIT-MRT/util_caching/releases) and install it with `dpkg`: | |
```bash | |
sudo dpkg -i util-caching*.deb | |
Download the [latest `.deb` package release](https://github.com/KIT-MRT/util_caching/releases/latest/download/util-caching_amd64.deb) and install it with `dpkg`: | |
```bash | |
sudo dpkg -i util-caching_amd64.deb |
I've seen this in other projects, but not sure if that's good practise.
On the other hand, it also eases the integration in automated installs, like in docker.
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.
Yes, let's do that. I think having a static link here is quite beneficial.
What about the architecture in the file name? As you mentioned, this is header only, so the deb file should work everywhere right?
Should I just set
set(CPACK_DEBIAN_FILE_NAME "${PROJECT_NAME}.deb")
in cpack_config.cmake
?
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.
What about the architecture in the file name? As you mentioned, this is header only, so the deb file should work everywhere right?
Right, let's then call the packages and deb files -dev
. That should follow the debian style as well (except for the dropped version).
I'll provide a change for that.
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.
libutil-caching-dev
?
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.
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.
Yes, that sounds about right. 👍
1997e0d
to
6e22a2e
Compare
Simplify the way the release body is defined. Co-authored-by: Piotr Spieker <[email protected]>
e0655ce
to
c0e3685
Compare
124f963
to
833222e
Compare
This adds GitHub Actions to the repository that do the following:
version
file, add/commit the new version and git tag this commit. By default, this bumps the minor version but this can be adjusted using the #major, #minor, #patch keywords in the commit message.