Skip to content

Commit 685bd33

Browse files
authored
Merge pull request #971 from benoit-pierre/circleci_2.0
circleci: migrate configuration to 2.0
2 parents ca16298 + 41b8271 commit 685bd33

File tree

5 files changed

+92
-28
lines changed

5 files changed

+92
-28
lines changed

.circleci/config.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
version: 2
2+
3+
4+
variables:
5+
6+
macos: &macos
7+
macos:
8+
xcode: "9.0"
9+
environment:
10+
CIRCLE_ARTIFACTS: /tmp/circleci/artifacts
11+
12+
restore_cache: &restore_cache
13+
restore_cache:
14+
keys:
15+
# This branch if available
16+
- v1-dep-{{ .Branch }}-
17+
# Default branch if not
18+
- v1-dep-master-
19+
20+
save_cache: &save_cache
21+
save_cache:
22+
key: v1-dep-{{ .Branch }}-{{ epoch }}
23+
paths:
24+
- .cache
25+
26+
setup: &setup
27+
run:
28+
name: Setting-up build environment
29+
command: ./ci/circle.sh setup
30+
31+
build: &build
32+
run:
33+
name: Running tests and building distribution
34+
command: ./ci/circle.sh build
35+
36+
store_artifacts: &store_artifacts
37+
store_artifacts:
38+
path: /tmp/circleci/artifacts
39+
40+
deploy: &deploy
41+
run:
42+
name: Deploying to GitHub
43+
command: ./ci/circle.sh deploy
44+
45+
jobs:
46+
47+
build_and_test:
48+
<<: *macos
49+
steps:
50+
- checkout
51+
- *restore_cache
52+
- *setup
53+
- *build
54+
- *store_artifacts
55+
- *save_cache
56+
57+
build_test_and_release:
58+
<<: *macos
59+
steps:
60+
- checkout
61+
- *restore_cache
62+
- *setup
63+
- *build
64+
- *store_artifacts
65+
- *deploy
66+
- *save_cache
67+
68+
69+
workflows:
70+
71+
version: 2
72+
73+
branch:
74+
jobs:
75+
- build_and_test:
76+
filters:
77+
tags:
78+
ignore: /.*/
79+
80+
tag:
81+
jobs:
82+
- build_test_and_release:
83+
filters:
84+
branches:
85+
ignore: /.*/
86+
tags:
87+
only: /.*/

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ exclude archlinux/.gitignore
3838
exclude plover/gui_qt/*_rc.py
3939
exclude plover/gui_qt/*_ui.py
4040
exclude plover/gui_qt/.gitignore
41+
prune .circleci
4142
prune .github
4243
prune ci

ci/circle.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ download()
3636

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

4849
build()
4950
{
50-
run git fetch --quiet --unshallow
5151
run "$python" setup.py patch_version
5252
run "$python" setup.py test
5353
run "$python" setup.py bdist_dmg
@@ -61,15 +61,14 @@ deploy()
6161
github_release_url='https://github.com/aktau/github-release/releases/download/v0.7.2/darwin-amd64-github-release.tar.bz2'
6262
github_release_sha1='16d40bcb4de7e29055789453f0d5fdbf1bfd3b49'
6363
github_release_exe='./bin/darwin/amd64/github-release'
64-
github_release_opts=(--user openstenoproject --repo plover --tag "$("$python" ./setup.py --version)")
64+
github_release_opts=(--user "$CIRCLE_PROJECT_USERNAME" --repo "$CIRCLE_PROJECT_REPONAME" --tag "$CIRCLE_TAG")
6565
run [ -r "$artifact" ]
6666
run "$python" -m plover_build_utils.download "$github_release_url" "$github_release_sha1" "$github_release"
6767
run tar xvjf "$github_release"
6868
run "$github_release_exe" release "${github_release_opts[@]}" --draft
69-
run "$github_release_exe" upload "${github_release_opts[@]}" --file "$artifact" --name "${artifact#*/}"
69+
run "$github_release_exe" upload "${github_release_opts[@]}" --file "$artifact" --name "${artifact##*/}"
7070
}
7171

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

7574
python='python3'

circle.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Babel==2.4.0
22
check-manifest==0.35
33
Cython==0.25.2
4-
dmgbuild==1.3.2; "darwin" in sys_platform
4+
https://github.com/benoit-pierre/dmgbuild/archive/plover.zip; "darwin" in sys_platform
55
docutils==0.14
66
macholib==1.8; "darwin" in sys_platform
77
pip==9.0.1

0 commit comments

Comments
 (0)