on master help sign in
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

commit9a3a5545e70d10f62d645e5f553b75ae13feb755 authorMartin Nordholts <enselic@gmail.com> dateSat 9 Jan 2021, 20:53 (6 years ago) parent4391906
1 file changed+2−2
.github/workflows/CICD.yml+2−2
.github/workflows/CICD.yml+2−2
@@ -2,6 +2,7 @@ name: CICD
22
33env:
44 PROJECT_NAME: bat
5+ PROJECT_VERSION: "0.17.1"
56 PROJECT_DESC: "A `cat` clone with wings"
67 PROJECT_MAINTAINER: "David Peter <mail@david-peter.de>"
78 PROJECT_HOMEPAGE: "https://github.com/sharkdp/bat"
@@ -116,10 +117,9 @@ jobs:
116117 echo ::set-output name=EXE_suffix::${EXE_suffix}
117118 # parse commit reference info
118119 unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac;
119− REF_SHAS=${GITHUB_SHA:0:8}
120120 # package name
121121 PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
122− PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }}
122+ PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}
123123 PKG_NAME=${PKG_BASENAME}${PKG_suffix}
124124 echo ::set-output name=PKG_BASENAME::${PKG_BASENAME}
125125 echo ::set-output name=PKG_NAME::${PKG_NAME}