-
Notifications
You must be signed in to change notification settings - Fork 17
Release to Github with Jreleaser #12
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
id: vars | ||
shell: bash | ||
run: | | ||
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1) |
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.
Wouldn't be something like workflow_dispatch
cleaner than extracting the version from the Cargo.toml
file?
Something like
workflow_dispatch:
inputs:
version:
description: Release version
required: true
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 depends. If you pass the version as a workflow input don't you still have to update Cargo.toml and Cargo.lock before compilation?
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, I did this on purpose because in Rust projects the Cargo.toml
masters of the version. The sed
does feel a bit hacky though 🤔
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.
If Cargo.toml
is the source of truth wrt versioning then the GH action must read the version from there. We could use a different mechanism to extract the version tho.
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.
Yuck! And there is no way to pass in the version. Even good ol' Maven allows this.
jreleaser.toml
Outdated
windows-x86_64 = "x86_64-pc-windows-msvc" | ||
|
||
[release.github] | ||
name = "sdkman-native-cli" |
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 could be omitted as the name is grabbed from the .git
metadata. If it's set explicitly then it must be changed to match the name of the repository, "sdkman-cli-native"
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.
Just that one line, or the entire [release.github]
block?
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.
Just that line 😀
I've used the TOML descriptor as this is more idiomatic in a Rust project.