-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75ab6b0
commit af345fe
Showing
6 changed files
with
176 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
defaults: &defaults | ||
working_directory: ~/build | ||
docker: | ||
- image: quay.io/haskell_works/stack-build-cabal | ||
|
||
# - image: confluentinc/cp-zookeeper:3.1.2 | ||
# environment: | ||
# ZOOKEEPER_CLIENT_PORT: 2181 | ||
|
||
# - image: confluentinc/cp-kafka:3.1.2 | ||
# environment: | ||
# KAFKA_ZOOKEEPER_CONNECT: "localhost:2181" | ||
# KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://localhost:9092" | ||
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
|
||
steps: | ||
- checkout | ||
|
||
- restore_cache: | ||
keys: | ||
- dot-stack-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.yaml" }} | ||
- dot-stack-{{ arch }}-{{ .Environment.CIRCLE_JOB }} | ||
|
||
- restore_cache: | ||
key: stack-work-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.yaml" }} | ||
|
||
- run: stack setup --resolver ${LTS} ${STACK_ARGS} | ||
- run: stack build --test --no-run-tests --haddock --no-haddock-deps --resolver ${LTS} ${STACK_ARGS} | ||
|
||
- save_cache: | ||
key: dot-stack-{{ arch }}-{{ .Environment.CIRCLE_JOB }} | ||
paths: | ||
- ~/.stack | ||
|
||
- run: | ||
name: Running unit tests | ||
command: stack test --resolver ${LTS} ${STACK_ARGS} | ||
|
||
- save_cache: | ||
key: dot-stack-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.yaml" }} | ||
paths: | ||
- ~/.stack | ||
|
||
- save_cache: | ||
key: stack-work-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.yaml" }} | ||
paths: ~/build/.stack-work | ||
|
||
version: 2.0 | ||
jobs: | ||
lts-7: | ||
environment: | ||
- LTS: "lts-7" | ||
<<: *defaults | ||
|
||
lts-9: | ||
environment: | ||
- LTS: "lts-9" | ||
<<: *defaults | ||
|
||
lts-11: | ||
environment: | ||
- LTS: "lts-11" | ||
<<: *defaults | ||
|
||
nightly: | ||
environment: | ||
- LTS: "nightly" | ||
- STACK_ARGS: "--stack-yaml=stack-nightly.yaml" | ||
<<: *defaults | ||
|
||
release: | ||
working_directory: ~/build | ||
docker: | ||
- image: quay.io/haskell_works/stack-build-cabal | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Making a release | ||
command: ./scripts/release | ||
|
||
|
||
workflows: | ||
version: 2 | ||
multiple-ghcs: | ||
jobs: | ||
# - lts-7 | ||
- lts-9 | ||
- lts-11 | ||
# - nightly | ||
- release: | ||
requires: | ||
# - lts-7 | ||
- lts-9 | ||
- lts-11 | ||
# - nightly | ||
filters: | ||
branches: | ||
only: master | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$_system_type" == "Darwin" ]; then | ||
sed () { | ||
gsed "$@" | ||
} | ||
fi | ||
|
||
_version=$(cat package.yaml | grep -i -e "^version:" | cut -d : -f 2 | xargs) | ||
|
||
_branch=$(git rev-parse --abbrev-ref HEAD) | ||
_branch_prefix=${_branch%-branch} | ||
|
||
if [[ $(git ls-remote origin "refs/tags/v$_version") ]]; then | ||
echo "The tag v$_version already exists. Will not tag" | ||
exit 0 | ||
fi | ||
|
||
_commit=$(git rev-parse --verify HEAD) | ||
|
||
_release_data=$(cat <<EOF | ||
{ | ||
"tag_name": "v$_version", | ||
"target_commitish": "$_commit", | ||
"name": "v$_version", | ||
"body": "New release", | ||
"draft": false, | ||
"prerelease": false | ||
} | ||
EOF | ||
) | ||
|
||
echo "Creating release v$_version from commit $_commit in branch $_branch" | ||
|
||
set -x | ||
|
||
_release=$( | ||
curl -H "Authorization: token $GITHUB_TOKEN" \ | ||
-X POST https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases \ | ||
--data "$_release_data" | ||
) | ||
|
||
_release_id=$( | ||
echo "$_release" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=' | cut -d '=' -f 2 | ||
) | ||
|
||
echo "Released on GitHub as as v$_version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resolver: nightly | ||
allow-newer: true | ||
|
||
packages: | ||
- '.' | ||
|
||
# Dependency packages to be pulled from upstream that are not in the resolver | ||
# (e.g., acme-missiles-0.3) | ||
extra-deps: | ||
- avro-0.3.0.4 | ||
- pure-zlib-0.6.3 | ||
|
||
# Override default flag values for local packages and extra-deps | ||
flags: {} | ||
|
||
# Extra package databases containing global packages | ||
extra-package-dbs: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters