diff --git a/.cirrus.yml b/.cirrus.yml index 23f55718c..fc485cb1c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -10,7 +10,7 @@ build_task: folder: /var/cache/pkg install_script: - - pkg install -y postgresql95-client ghc hs-cabal-install jq + - pkg install -y postgresql95-client ghc hs-cabal-install jq git # cache the hackage index file and downloads which are # cabal v2-update downloads an incremental update, so we don't need to keep this up2date @@ -43,9 +43,7 @@ build_task: if test $CIRRUS_TAG = "nightly" then - date=$(date +'%F') - sha=$(echo $CIRRUS_CHANGE_IN_REPO | head -c7) - suffix=$date-$sha + suffix=$(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M") bin_name=postgrest-nightly-$suffix-freebsd.tar.xz else bin_name=postgrest-$CIRRUS_TAG-freebsd.tar.xz diff --git a/.travis.yml b/.travis.yml index a90912ac1..f00aff7c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,9 +59,7 @@ jobs: repo="$(echo "$TRAVIS_REPO_SLUG" | cut -f2 -d/)" if test $TRAVIS_TAG = "nightly" then - date=$(date +'%F') - sha=$(echo $TRAVIS_COMMIT | head -c7) - suffix=$date-$sha + suffix=$(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M") strip postgrest tar cJf postgrest-nightly-$suffix-osx.tar.xz postgrest ghr -t $GITHUB_TOKEN -u $owner -r $repo --replace nightly postgrest-nightly-$suffix-osx.tar.xz diff --git a/appveyor.yml b/appveyor.yml index c83f23193..50c220741 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,14 +32,12 @@ artifacts: - path: postgrest.exe deploy_script: -## set the env vars outside of the IF because that doesn't work: https://stackoverflow.com/questions/9102422/windows-batch-set-inside-if-not-working -- set DATE=%APPVEYOR_REPO_COMMIT_TIMESTAMP:~0,10% -- set SHA=%APPVEYOR_REPO_COMMIT:~0,7% -- set SUFFIX=%DATE%-%SHA% +## Use powershell(ps) for this because CMD commands having "%" don't work(even by escaping with "%%"). See https://github.com/appveyor/ci/issues/246. +- ps: $env:suffix=(git show -s --format="%cd-%h" --date="format:%Y-%m-%d-%H-%M") - IF DEFINED APPVEYOR_REPO_TAG_NAME ( IF "%APPVEYOR_REPO_TAG_NAME%"=="nightly" ( - 7z a -tzip postgrest-nightly-%SUFFIX%-windows-x64.zip postgrest.exe && - bash -lc "exec 0