Skip to content

Conversation

@illwieckz
Copy link
Member

@illwieckz illwieckz commented Feb 14, 2022

build-release: write version string like Urcheon

Keep the possibility to append username (something Urcheon does not) but make
it optional and not enabled by default.

Note: appending username is convenient when modding.

Keep the possibility to append username (something Urcheon does not)
but make it optional and not enabled by default.
@slipher
Copy link
Contributor

slipher commented Feb 14, 2022

Where does the string go? Can you give an example?

@illwieckz
Copy link
Member Author

…/Unvanquished $ ../unvanquished-release-scripts/build-release -v vm
[…]
Creating archive: …/Unvanquished/build/release/vm_0.52.1-20220213-205227-e971ec0.dpk

If HEAD was v0.52.1, it would produce vm_0.52.1.dpk.

@illwieckz illwieckz changed the title write version string a bit like Urcheon write version string like Urcheon Feb 15, 2022
@illwieckz
Copy link
Member Author

So, I improved the version compute, it now takes care of situations like no git repo, no commit, not version tag.

I'll probably backport the code to Urcheon as this one is simpler and much faster (I had less git knowledge when I did the code in Urcheon).

build-release Outdated

if [ -n "${git_last_commit}" ]
then
local git_last_commit_short="${git_last_commit:0:7}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use git rev-parse --short HEAD for the short hash

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

build-release Outdated
git_ref="$(git describe --tags --match 'v*' | cut -c2-)"
git_last_tag="$(git describe --tags --match 'v*' | cut -f1 -d'-' | cut -c2-)"
git_last_date="$(date --date="@$(git log -1 '--pretty=format:%ct')" -u '+%Y%m%d-%H%M%S')"
build_version+="$(printVersion)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why += ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@slipher
Copy link
Contributor

slipher commented Sep 10, 2022

LGTM

@illwieckz illwieckz merged commit ec564ff into Unvanquished:master Sep 10, 2022
@illwieckz illwieckz deleted the version branch September 10, 2022 17:24
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.

2 participants