Skip to content

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

Merged
merged 2 commits into from
Feb 4, 2022
Merged

Release to Github with Jreleaser #12

merged 2 commits into from
Feb 4, 2022

Conversation

marc0der
Copy link
Member

@marc0der marc0der commented Feb 4, 2022

I've used the TOML descriptor as this is more idiomatic in a Rust project.

@marc0der marc0der requested a review from helpermethod February 4, 2022 09:38
id: vars
shell: bash
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)
Copy link
Member

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

Copy link
Contributor

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?

Copy link
Member Author

@marc0der marc0der Feb 4, 2022

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 🤔

Copy link
Contributor

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.

Copy link
Member

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.

rust-lang/cargo#6583

jreleaser.toml Outdated
windows-x86_64 = "x86_64-pc-windows-msvc"

[release.github]
name = "sdkman-native-cli"
Copy link
Contributor

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"

Copy link
Member Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just that line 😀

@marc0der marc0der merged commit 3b4df61 into master Feb 4, 2022
@marc0der marc0der deleted the release_it branch February 4, 2022 22:42
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.

3 participants