Skip to content

Commit

Permalink
ci: add nightly version to cabal file
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-chavez committed Nov 11, 2020
1 parent 6de5a59 commit 61763a9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ jobs:
command: |
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use postgrest
- run:
name: Change postgrest.cabal if nightly
command: |
if test "$CIRCLE_TAG" = "nightly"
then
cabal_nightly_version=$(git show -s --format='%cd' --date='format:%Y%m%d')
sed -i "s/^version:.*/version:$cabal_nightly_version/" postgrest.cabal
fi
- run:
name: Build all derivations from default.nix and push results to Cachix
command: |
Expand Down
6 changes: 6 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ build_task:

build_script:
- cabal v2-update
- |
if test "$CIRRUS_TAG" = "nightly"
then
cabal_nightly_version=$(git show -s --format='%cd' --date='format:%Y%m%d')
sed -i '' "s/^version:.*/version:$cabal_nightly_version/" postgrest.cabal
fi
- cabal v2-build

publish_script:
Expand Down
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
rm ghr.zip
fi
script:
- |
if test "$TRAVIS_TAG" = "nightly"
then
cabal_nightly_version=$(git show -s --format='%cd' --date='format:%Y%m%d')
sed -i '' "s/^version:.*/version:$cabal_nightly_version/" postgrest.cabal
fi
## Building the whole project can take longer than 50 minutes. Since Travis has a global timeout of 50 minutes
## we compile for 30 minutes tops(`gtimeout 1800`) and quit compiling with no error.
## Since we CACHE the compile results we can continue compiling from where we left off
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ install:
- go get -u github.com/tcnksm/ghr

build_script:
- ps: $env:cabal_nightly_version=(git show -s --format='%cd' --date='format:%Y%m%d')
- IF "%APPVEYOR_REPO_TAG_NAME%"=="nightly" bash -lc "sed -i -r \"s/^(version:\s+)\S+$/\1$cabal_nightly_version/\" postgrest.cabal"
- stack setup --no-terminal > nul
# Appveyor has a timeout of 60 mins, building can take longer, limit the time and make sure this succeeds,
# previous work will get cached and finish on next commit
Expand Down

0 comments on commit 61763a9

Please sign in to comment.