Commit 1d4232dd authored by Oliver Lowe's avatar Oliver Lowe
Browse files

Append gitlabci build number to package version field

For more info, see
https://gitlab.sol1.net/salsa/salsa/-/blob/master/RELEASE.md
parent 1d9a0bb7
......@@ -6,6 +6,8 @@ package:
image: debian
stage: package
script:
- cp dist/control dist/control.skel
- dist/bumpver dist/control.skel > dist/control
- debian/mkdeb
artifacts:
paths:
......
#!/usr/bin/awk -f
# bumpver prints a modified debian package control file based on
# environment variables set from Gitlab CI. If a tagged revision is
# being built, then the Version field is the plain semver. Otherwise,
# the version from the control file has the Gitlab CI pipeline ID
# appended.
/Version/ {
if (ENVIRON["CI_COMMIT_TAG"]) {
# strip "v" prefix from tag
semver = ENVIRON["CI_COMMIT_TAG"]
sub("^v", "", semver)
printf "%s %s\n", $1, semver
next
}
printf("%s-%d\n", $0, ENVIRON["CI_PIPELINE_IID"])
next
}
{
print
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment