Add version file

This commit is contained in:
Neil Alexander 2018-03-04 11:09:17 +00:00
parent 54a742d576
commit e43776f90e
3 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@ jobs:
name: Create artifact upload directory and set variables name: Create artifact upload directory and set variables
command: | command: |
mkdir /tmp/upload mkdir /tmp/upload
echo 'export CIBUILD=0.1.$(git rev-list HEAD --count | xargs printf "%04d")' >> $BASH_ENV echo 'export CIBUILD=$(cat VERSION).$(git rev-list HEAD --count | xargs printf "%04d")' >> $BASH_ENV
echo 'export CIBRANCH=$(git name-rev --name-only HEAD)' >> $BASH_ENV echo 'export CIBRANCH=$(git name-rev --name-only HEAD)' >> $BASH_ENV
echo '[ "$CIBRANCH" != "master" ] && export CIVERSION=$CIBRANCH-$CIBUILD || export CIVERSION=$CIBUILD' >> $BASH_ENV echo '[ "$CIBRANCH" != "master" ] && export CIVERSION=$CIBRANCH-$CIBUILD || export CIVERSION=$CIBUILD' >> $BASH_ENV

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.1

View File

@ -14,7 +14,7 @@ PKGBRANCH=$(basename `git name-rev --name-only HEAD`)
if [ "$PKGBRANCH" = "master" ]; then PKGNAME=yggdrasil if [ "$PKGBRANCH" = "master" ]; then PKGNAME=yggdrasil
else PKGNAME=yggdrasil-${PKGBRANCH}; fi else PKGNAME=yggdrasil-${PKGBRANCH}; fi
PKGARCH=${PKGARCH-amd64} PKGARCH=${PKGARCH-amd64}
PKGVERSION=0.$(git rev-list HEAD --count 2>/dev/null | xargs printf "%04d") PKGVERSION=$(cat VERSION).$(git rev-list HEAD --count 2>/dev/null | xargs printf "%04d")
PKGFILE=$PKGNAME-$PKGVERSION-$PKGARCH.deb PKGFILE=$PKGNAME-$PKGVERSION-$PKGARCH.deb
if [ $PKGARCH = "amd64" ]; then GOARCH=amd64 GOOS=linux ./build if [ $PKGARCH = "amd64" ]; then GOARCH=amd64 GOOS=linux ./build