Skip to content

Commit

Permalink
circleci: migrate configuration to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-pierre committed Jun 7, 2018
1 parent ace4050 commit 41b8271
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 28 deletions.
87 changes: 87 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
version: 2


variables:

macos: &macos
macos:
xcode: "9.0"
environment:
CIRCLE_ARTIFACTS: /tmp/circleci/artifacts

restore_cache: &restore_cache
restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-

save_cache: &save_cache
save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- .cache

setup: &setup
run:
name: Setting-up build environment
command: ./ci/circle.sh setup

build: &build
run:
name: Running tests and building distribution
command: ./ci/circle.sh build

store_artifacts: &store_artifacts
store_artifacts:
path: /tmp/circleci/artifacts

deploy: &deploy
run:
name: Deploying to GitHub
command: ./ci/circle.sh deploy

jobs:

build_and_test:
<<: *macos
steps:
- checkout
- *restore_cache
- *setup
- *build
- *store_artifacts
- *save_cache

build_test_and_release:
<<: *macos
steps:
- checkout
- *restore_cache
- *setup
- *build
- *store_artifacts
- *deploy
- *save_cache


workflows:

version: 2

branch:
jobs:
- build_and_test:
filters:
tags:
ignore: /.*/

tag:
jobs:
- build_test_and_release:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ exclude archlinux/.gitignore
exclude plover/gui_qt/*_rc.py
exclude plover/gui_qt/*_ui.py
exclude plover/gui_qt/.gitignore
prune .circleci
prune .github
prune ci
7 changes: 3 additions & 4 deletions ci/circle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ download()

setup()
{
mkdir -p "$CIRCLE_ARTIFACTS"
# Install Python.
download 'python36.pkg' 'https://www.python.org/ftp/python/3.6.2/python-3.6.2-macosx10.6.pkg' '86e6193fd56b1e757fc8a5a2bb6c52ba'
run sudo installer -pkg "$downloads/python36.pkg" -target /
Expand All @@ -47,7 +48,6 @@ setup()

build()
{
run git fetch --quiet --unshallow
run "$python" setup.py patch_version
run "$python" setup.py test
run "$python" setup.py bdist_dmg
Expand All @@ -61,15 +61,14 @@ deploy()
github_release_url='https://github.com/aktau/github-release/releases/download/v0.7.2/darwin-amd64-github-release.tar.bz2'
github_release_sha1='16d40bcb4de7e29055789453f0d5fdbf1bfd3b49'
github_release_exe='./bin/darwin/amd64/github-release'
github_release_opts=(--user openstenoproject --repo plover --tag "$("$python" ./setup.py --version)")
github_release_opts=(--user "$CIRCLE_PROJECT_USERNAME" --repo "$CIRCLE_PROJECT_REPONAME" --tag "$CIRCLE_TAG")
run [ -r "$artifact" ]
run "$python" -m plover_build_utils.download "$github_release_url" "$github_release_sha1" "$github_release"
run tar xvjf "$github_release"
run "$github_release_exe" release "${github_release_opts[@]}" --draft
run "$github_release_exe" upload "${github_release_opts[@]}" --file "$artifact" --name "${artifact#*/}"
run "$github_release_exe" upload "${github_release_opts[@]}" --file "$artifact" --name "${artifact##*/}"
}

[ "$CIRCLE_BUILD_IMAGE" == 'osx' ]
[ $# -eq 1 ]

python='python3'
Expand Down
23 changes: 0 additions & 23 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Babel==2.4.0
check-manifest==0.35
Cython==0.25.2
dmgbuild==1.3.2; "darwin" in sys_platform
https://github.com/benoit-pierre/dmgbuild/archive/plover.zip; "darwin" in sys_platform
docutils==0.14
macholib==1.8; "darwin" in sys_platform
pip==9.0.1
Expand Down

0 comments on commit 41b8271

Please sign in to comment.