Skip to content

Commit

Permalink
Use git tag as version identifier in package scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Feb 24, 2024
1 parent 8bf9b2d commit 3a1c353
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit 3a1c353

Please sign in to comment.