From a4f1bdb040a5bc7f1e1faf69bb604f8ab7b35e04 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 5 Jan 2021 09:53:45 -0600 Subject: default version to current tag and short git sha --- bin/build | 12 +++++++----- bin/publish | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/build b/bin/build index 23b09171..7c76b824 100755 --- a/bin/build +++ b/bin/build @@ -4,7 +4,9 @@ set -e web_only=false dotnet_only=false skip_tests=false -version_suffix=$(git rev-parse --short HEAD) +tag=$(git describe --tags) +sha=$(git rev-parse --short HEAD) +version=$tag-$sha while test $# -gt 0; do case "$1" in @@ -29,9 +31,9 @@ while test $# -gt 0; do skip_tests=true shift ;; - --version-suffix) + --version) shift - version_suffix=$1 + version=$1 shift ;; *) @@ -83,8 +85,8 @@ else echo $'\n> pwd\n' pwd - echo $'\n> dotnet build --no-incremental --nologo --configuration Release\n' - dotnet build --no-incremental --nologo --configuration Release --version-suffix $version_suffix + echo $'\n> dotnet build --no-incremental --nologo --configuration Release -p:Version '$version$'\n' + dotnet build --no-incremental --nologo --configuration Release -p:Version=$version if [ "$skip_tests" == true ]; then echo $'\ndotnet tests skipped\n' diff --git a/bin/publish b/bin/publish index 57623a7a..5106af53 100755 --- a/bin/publish +++ b/bin/publish @@ -2,7 +2,9 @@ set -e build=true -version_suffix=$(git rev-parse --short HEAD) +tag=$(git describe --tags) +sha=$(git rev-parse --short HEAD) +version=$tag-$sha while test $# -gt 0; do case "$1" in @@ -23,9 +25,9 @@ while test $# -gt 0; do runtime=$1 shift ;; - --version-suffix) + --version) shift - version_suffix=$1 + version=$1 shift ;; *) @@ -50,7 +52,7 @@ cd src/slskd echo $'\n> pwd\n' pwd -echo $'\n> dotnet publish ... --runtime '$runtime$' --version-suffix '$version_suffix$'\n' +echo $'\n> dotnet publish ... --runtime '$runtime$' -p:Version '$version$'\n' rm -rf dist/$runtime/* dotnet publish \ --configuration Release \ @@ -59,8 +61,8 @@ dotnet publish \ -p:PublishTrimmed=true \ -p:IncludeNativeLibrariesForSelfExtract=true \ -p:CopyOutputSymbolsToPublishDirectory=false \ + -p:Version=$version \ --self-contained \ - --version-suffix $version_suffix \ --runtime $runtime \ --output ../../dist/$runtime -- cgit v1.2.3