forked from codemagic-ci-cd/cli-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
69 lines (68 loc) · 9.72 KB
/
codemagic.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
workflows:
tests:
environment:
vars:
HOMEBREW_NO_AUTO_UPDATE: 1
MYPYPATH: stubs
TEST_APPLE_ISSUER_ID: Encrypted(Z0FBQUFBQmdmWF9lRkdUSjh0TkYxdkJsWExzZGdVbkpkWGY3eHBsU2Z3bGZ6aVpRVElFdklCYnFPWHc4RzI4bC13cUhaRF9GYnlUMDRVc2dGV3ZDNkFjR2ZHLVpUa2o5N3Y2TkhSRWhXY3I2S1l5dUdxRjRQaEQ3a0RXNWpHVHJxOGZyRlcwLXphN3Q=)
TEST_APPLE_KEY_IDENTIFIER: Encrypted(Z0FBQUFBQmdmWF9GaElkcWFRMTIzMUJfLU5WeDBZWVBCWWsydlhTS19lZ1Nkb1BZaTZiZG10V1IzWXVWaGxfWVhoWmNYMF9CdGtIdl9uaW9HUlZjY3FDYVYzV3VnUHVfc1E9PQ==)
TEST_APPLE_PRIVATE_KEY_CONTENT: Encrypted(Z0FBQUFBQmdmWUFBcExqYWdiN3RwMGZHZlFNLWNaRmg5SHdyNEdwVlR1Q3IxWkRlajllcEwxemRfcnpyUzBQTlRzN2EyX09vRGJWQzE1YTZKVmpOeC1FS1I1a0swRFZ1VUdGQ0RmRXVoVDltcUJ1ZEV1ZTZvMEFzY0pqcHQ5VDVUdEhaTWstUWRDWTQzRE53YWswci1UNVpOTWJTejZqT1VVWFBUdVVXTFBlR1RFd3dVZjVSR2lTODdpSzRKRm80eGpyWHhoSm5aVERLMTQ5TEhVQ2JiaDc5eXVZNTZ3R2JBY2FibDVLYUhib2ZLVklNcnFWRDNiUTEyRGxsNTFLUjdSV19LVU5USUZKRGV6TlZlOTF4NkZYVUE2Q0otXzdpMUtHY3ZTMzRkdF9MbTkwQ2tUTGN3TVdnUjNoNTQxOVFFb2xUZzlJQTJ0eXpaNGFUeGFqSW1EaF9EQ2RjeW9HVFNCNHc0dzB0bUF4YVBBM2dqb2o4S2wwYmdXbFdwUmtkYTdzeVVpYzJlUTNQV0lGUTVjMU9nZ2JvSEJoRy1iOEpMcWwwYjhRR2RBeXctNHg4Ump5RlNtRT0=)
scripts:
- name: Install pyenv
script: |
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
brew install pyenv
- name: Install dependencies
script: |
python3 -m pip install --upgrade pip pipenv
pipenv install --dev
- name: Pipenv checks
script: pipenv check
- name: Check code formatting
script: pipenv run flake8 src/codemagic tests
- name: Check imports sort order
script: pipenv run isort src/codemagic tests --check-only
- name: Static type checks with mypy
script: pipenv run mypy src/codemagic
- name: Test with pytest
script: pipenv run pytest
release:
environment:
vars:
GITHUB_TOKEN: Encrypted(Z0FBQUFBQmdkQXVZLUN0STF4WlBpMEFmc2V5Z2FmMi00bWtUeUFMREJxejNpaW85c3FwcWZsaU51a3BYWlcyc3FPbTlLM2dZeXgzdHY1VnRlX0RVZERmQlhiSlhzQ055YVgwV1R3MXV5N1dobHY5UnhkeHhadWw4cjFsUkNXTUxuTHlxWkduU3JEOHE=)
GOOGLE_CLIENT_SECRET: Encrypted(Z0FBQUFBQmQzbWh3dHNnNU5PV3g4SXpLaXhMbENiVkZKSXk1YVl4YmRPLTZoU29DMmU2NGJNNHpjQWthSTFjTWR4a091Q2FWQlpfMGw5emcxZkM3eUtQSW9QckpwWjl1cWItanJub2FFVWU5VXdTeS12VjNzLTZzamk3cE5PbWhma1J0d2dHaGduQ0JKeHVyVXN0TkkyNlVFOGFVQ3dBakRKMkN2T2Rva3BFUHM1cER5UTFGUzJtNGVRS3d0VFAyMkRyUjRLUkpRbXA4Y2VGdE82aWk4VlR0aXVicDQyU0Zr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X0N5U2p2QnhnUFBuWGVCZjBmTkxTalB5cldOQWNBZ0dTcGRveGpHQ1g0a3c4VGoxX3l3UDBzVjNBcjRkRHFjcTZPelRsN21kNUlSMk02b2NvUT09)
PYPI_USER: __token__
PYPI_TOKEN: Encrypted(Z0FBQUFBQmU2TTJqVVYxSy04cm1qOGJzUWhtekNRQ3lGNjdYUTFiUGwybHc2RENLVFo0SDVTVUhyR1JrMkMxckV3QnpFWWxWa0pZVXFsM29aM2djRThUYUlWMlNBMjdWaHQzSm16UjlTSVRocXpWenBhZ20tTjhPU1dZWFNwOHFEWUR3X2pBdC10eGV5cXNvSkpRV2djQncyMWgwdEZzMlhQRC1kcEw5VThTSTcxWUhKQnFrMU5Fc3gtQ29WSDhORHpyMmI1ODh0cFhwMXBhcGRpWDR2b0Q3ZFhBdVFQWlBKSjFxekloUERBV2g2S2piejhubWN5Y3VsOUdhai1xZXlvcWxsbHVSU1dOQ2hmak9jc0pGOXpBN1FYZ01HUzl6U3RTd2dwU1h4NXJBQzY1MmszeXlZS1NoNDhZNEdkMVZlTkZqQVVzRWVoSGRsLXhoRXZYMXd5V1B1U1h1UUdPNzRKcnh6REVxWVBtOVkwbXdJS3QxU1E4PQ==)
name: Generate binary distribution wheel
scripts:
- name: Build wheel
script: |
python3 -m pip install wheel
python3 setup.py sdist bdist_wheel
- name: Draft GitHub release
script: |
TAG_NAME=v$(python3 setup.py --version)
previous_version_line=$(grep -n "^Version " CHANGELOG.md | head -2 | tail -1 | cut -f1 -d:)
head -n "$(($previous_version_line - 1))" CHANGELOG.md | tail +3 > release_notes.md
gh release create "${TAG_NAME}" \
--title "${TAG_NAME}" \
--notes-file release_notes.md \
--draft \
dist/codemagic*.whl
- name: Upload wheel
script: |
set -e
echo $GOOGLE_CLIENT_SECRET | base64 --decode --output $HOME/client-secret.json
gcloud auth activate-service-account --key-file $HOME/client-secret.json
SRC_PATH=$(find dist -name "*.whl" | tail -n1)
DST_URL="gs://static.codemagic.io/builder/codemagic_cli_tools-latest-py3-none-any.whl"
gsutil -h "Content-Type:application/x-wheel+zip" \
-h "Cache-Control:no-cache,max-age=0" \
cp -a public-read "$SRC_PATH" "$DST_URL"
- name: Publish release to PyPI codemagic-cli-tools
script: |
python3 -m pip install --user --upgrade twine
python3 -m twine upload dist/* --username $PYPI_USER --password $PYPI_TOKEN
artifacts:
- dist/codemagic*.whl
- dist/codemagic*.tar.gz