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

Use git tag as version identifier in package scripts #1033

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/scripts/.package.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,13 @@ ${_usage_host:-}"

local product_name
local product_version
local git_tag="$(git describe --tags)"
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"

log_info "Using git tag as version identifier '${git_tag}'"
product_version="${git_tag}"

if [[ ${host_os} == macos ]] {
autoload -Uz check_packages read_codesign read_codesign_installer read_codesign_pass

Expand Down Expand Up @@ -247,15 +251,19 @@ ${_usage_host:-}"
cmake --build build_${target##*-} --config ${config} -t package_source ${cmake_args}
popd

local output_name="${product_name}-${product_version}-${target##*-}-linux-gnu"

if (( package )) {
log_group "Packaging ${product_name}..."
pushd ${project_root}
cmake --build build_${target##*-} --config ${config} -t package ${cmake_args}

mv ${project_root}/release/*.deb ${project_root}/release/${output_name}.deb
mv ${project_root}/release/*.ddeb ${project_root}/release/${output_name}.ddeb
popd
}

log_group "Archiving ${product_name}..."
local output_name="${product_name}-${product_version}-${target##*-}-linux-gnu"
local _tarflags='cJf'
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"

Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ function Package {
$ProductName = $BuildSpec.name
$ProductVersion = $BuildSpec.version

$GitOutput = git describe --tags
Log-Information "Using git tag as version identifier '${GitOutput}'"
$ProductVersion = $GitOutput

$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}"

if ( ! $SkipDeps ) {
Expand Down
Loading