From 9a3a5545e70d10f62d645e5f553b75ae13feb755 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 9 Jan 2021 20:53:54 +0100 Subject: [PATCH] CICD: Build: Use Cargo.toml version instead of tag This enables us to later always build Debian packages. If you try to use a git sha as Debian package version you will get an error: dpkg-deb: error: parsing file '_staging/dpkg/DEBIAN/control' near line 2 package 'bat': error in 'Version' field string 'd2963ce4': version number does not start with digit so we need to use a version that is always available. We duplicate the bat version in another place here which is a bit bad, but it is already duplicated a lot, so we don't make things significantly worse. It is still kind of nice to not have to figure out a good and robust way to parse out the version from Cargo.toml in the CI script. For #1474 --- .github/workflows/CICD.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 591b6258..d4c29cdd 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -2,6 +2,7 @@ name: CICD env: PROJECT_NAME: bat + PROJECT_VERSION: "0.17.1" PROJECT_DESC: "A `cat` clone with wings" PROJECT_MAINTAINER: "David Peter " PROJECT_HOMEPAGE: "https://github.com/sharkdp/bat" @@ -116,10 +117,9 @@ jobs: echo ::set-output name=EXE_suffix::${EXE_suffix} # parse commit reference info unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac; - REF_SHAS=${GITHUB_SHA:0:8} # package name PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac; - PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }} + PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }} PKG_NAME=${PKG_BASENAME}${PKG_suffix} echo ::set-output name=PKG_BASENAME::${PKG_BASENAME} echo ::set-output name=PKG_NAME::${PKG_NAME}