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

Include git hash in snapshot build versions #2547

Closed
wants to merge 1 commit into from

Conversation

jtuc
Copy link
Contributor

@jtuc jtuc commented Dec 15, 2024

What

Include git hash in snapshot builds, and build PRs as snapshots

Implementation Details

This uses the palantir git-version plugin, which annoyingly has a hardcoded printVersion task. I've renamed GTM's printVersion to printModVersion to avoid the clash, and adjusted github actions to compensate.

Outcome

Fixes #2539 (although that issue does also ask for Github PR numbers etc, I think the commithash is the most important info.)

Additional Information

2024-12-15_00 04 41

Potential Compatibility Issues

I think the "Sync Github Folder" action will only take the action changes and not the gradle changes - so this would probably need to be merged to 1.21 manually.

Also build PRs as snapshots, and rename the printVersion task to printModVersion
(Annoyingly, the palantir git-version plugin adds its own task named printVersion)
@jtuc jtuc requested a review from a team as a code owner December 15, 2024 00:07
@jtuc jtuc changed the title Include git hash in snapshot builds Include git hash in snapshot build versions Dec 15, 2024
Copy link
Member

@screret screret left a comment

Choose a reason for hiding this comment

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

This breaks the maven snapshot publishing.

@jtuc
Copy link
Contributor Author

jtuc commented Dec 15, 2024

Ah, good point. I thought this would just be a quick tweak, but I should probably leave it to someone with the permissions/keys/etc to test the workflows.

@jtuc jtuc closed this Dec 15, 2024
@krossgg
Copy link
Contributor

krossgg commented Dec 15, 2024

If you want to reattempt it, just have the workflows rename all the JARs before uploading instead of doing it in gradle. It won't mess with maven. You can ping me in Discord if you want help.
Or if you don't care enough to do it, I'll get around to it sooner or later.

@jtuc
Copy link
Contributor Author

jtuc commented Dec 15, 2024

Just renaming the JARs on PRs would probably be fine, but I did really like seeing the hash in-game via mods.toml. Maybe I'll revisit it, but I closed this PR as I don't really think it's a huge priority either.

@tomprince
Copy link
Contributor

but I did really like seeing the hash in-game via mods.toml

I would definitely prefer if the mods were detected as having the additional version metadata by things like Prism.

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.

[build] Include better version numbers in github built artifacts.
4 participants