diff --git a/.github/actions/build-asset-unix.sh b/.github/actions/build-asset-unix.sh index 2ff28d7c..b7fc8920 100755 --- a/.github/actions/build-asset-unix.sh +++ b/.github/actions/build-asset-unix.sh @@ -25,6 +25,12 @@ bash -eo pipefail ../embed-version.sh cmake --build . --target bladebit --config Release -j $thread_count chmod +x ./bladebit +if [[ $OSTYPE == 'msys'* ]] || [[ $OSTYPE == 'cygwin'* ]]; then + ls -la Release +else + ls -la +fi + # Ensure bladebit version matches expected version bb_version="$(./bladebit --version | xargs)" @@ -33,6 +39,7 @@ if [[ "$bb_version" != "$BB_VERSION" ]]; then exit 1 fi +tar --version tar -czvf $BB_ARTIFACT_NAME bladebit mkdir ../bin mv $BB_ARTIFACT_NAME ../bin/ diff --git a/.github/actions/get-version.sh b/.github/actions/get-version.sh index 4c7ed90b..81dea115 100755 --- a/.github/actions/get-version.sh +++ b/.github/actions/get-version.sh @@ -6,12 +6,15 @@ set -eo pipefail os=$1 arch=$2 -version_cmp=($(./extract-version.sh)) +shift $# -ver_maj=${version_cmp[0]} -ver_min=${version_cmp[1]} -ver_rev=${version_cmp[2]} -ver_suffix=${version_cmp[3]} +# version_cmp=($(./extract-version.sh)) +. ./extract-version.sh + +ver_maj=$bb_ver_maj +ver_min=$bb_ver_min +ver_rev=$bb_ver_rev +ver_suffix=$bb_version_suffix version="${ver_maj}.${ver_min}.${ver_rev}${ver_suffix}" diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index db4d6908..bef7e232 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -163,6 +163,7 @@ jobs: mkdir ../bin cd Release + ls -la 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe ls -la ../../bin @@ -203,7 +204,7 @@ jobs: if-no-files-found: error build-macos-x86-64: - runs-on: macOS-latest + runs-on: macOS-11 steps: - name: Cleanup Environment uses: Chia-Network/actions/clean-workspace@main diff --git a/embed-version.sh b/embed-version.sh index c2e1dd7b..f9c8d834 100755 --- a/embed-version.sh +++ b/embed-version.sh @@ -2,13 +2,14 @@ set -eo pipefail cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -version=($(./extract-version.sh)) +# version=($(./extract-version.sh)) +. ./extract-version.sh -ver_maj=${version[0]} -ver_min=${version[1]} -ver_rev=${version[2]} -ver_suffix=${version[3]} -git_commit=${version[4]} +ver_maj=$bb_ver_maj +ver_min=$bb_ver_min +ver_rev=$bb_ver_rev +ver_suffix=$bb_version_suffix +git_commit=$bb_git_commit echo "Version: $ver_maj.$ver_min.$ver_rev$ver_suffix" echo "Commit : $git_commit" diff --git a/extract-version.sh b/extract-version.sh index c15e8107..5797c556 100755 --- a/extract-version.sh +++ b/extract-version.sh @@ -8,28 +8,30 @@ ver_component=$1 # The user specified a specified component from the full veris # See the case switch below. # Grab version specified in the file -set IFS= +_IFS=IFS +IFS= version_str=$(cat VERSION | head -n 1 | xargs) -version_suffix=$(cat VERSION | tail -n 1 | xargs) +bb_version_suffix=$(cat VERSION | tail -n 1 | xargs) version_header='src/Version.h' +IFS=$_IFS -if [[ "$version_str" == "$version_suffix" ]]; then - version_suffix= +if [[ "$version_str" == "$bb_version_suffix" ]]; then + bb_version_suffix= fi -ver_maj=$(printf $version_str | sed -E -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/' | xargs) -ver_min=$(printf $version_str | sed -E -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/' | xargs) -ver_rev=$(printf $version_str | sed -E -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/' | xargs) +bb_ver_maj=$(printf $version_str | sed -E -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/' | xargs) +bb_ver_min=$(printf $version_str | sed -E -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/' | xargs) +bb_ver_rev=$(printf $version_str | sed -E -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/' | xargs) -git_commit=$GITHUB_SHA -if [[ -z $git_commit ]]; then +bb_git_commit=$GITHUB_SHA +if [[ -z $bb_git_commit ]]; then set +e - git_commit=$(git rev-parse HEAD) + bb_git_commit=$(git rev-parse HEAD) set -e fi -if [[ -z $git_commit ]]; then - git_commit="unknown" +if [[ -z $bb_git_commit ]]; then + bb_git_commit="unknown" fi # Check if the user wants a specific component @@ -38,23 +40,23 @@ if [[ -n $ver_component ]]; then case "$ver_component" in "major") - echo -n $ver_maj + echo -n $bb_ver_maj ;; "minor") - echo -n $ver_min + echo -n $bb_ver_min ;; "revision") - echo -n $ver_rev + echo -n $bb_ver_rev ;; "suffix") - echo -n $version_suffix + echo -n $bb_version_suffix ;; "commit") - echo -n $git_commit + echo -n $bb_git_commit ;; *) @@ -66,8 +68,9 @@ if [[ -n $ver_component ]]; then fi # Emit all version components -echo "$ver_maj" -echo "$ver_min" -echo "$ver_rev" -echo "$version_suffix" -echo "$git_commit" +# echo "$bb_ver_maj" +# echo "$bb_ver_min" +# echo "$bb_ver_rev" +# echo "$bb_version_suffix" +# echo "$bb_git_commit" +