1919 - checkout # check out source code to working directory
2020 - run : sudo chown -R circleci:circleci /usr/local/bin
2121 - restore_cache :
22- # Read about caching dependencies: https://circleci.com/docs/2.0/caching/
22+ # Read about caching dependencies: https://circleci.com/docs/2.0/caching/
2323 key : deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
2424 - run :
2525 command : |
4545 - restore_cache :
4646 key : deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
4747 - run :
48- command : |
49- make setup
48+ command : |
49+ make setup
5050 - save_cache :
5151 key : deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
5252 paths :
5656 git config --local user.email "sysadmin@binary.com"
5757 git config --local user.name "gh-pages deploy bot"
5858 make gh-pages
59+ update_schema :
60+ << : *default
61+ steps :
62+ - add_ssh_keys :
63+ fingerprints :
64+ - " c8:f7:fc:a0:0d:2c:43:93:e3:c7:b6:cf:16:93:98:e1"
65+ - checkout
66+ - run :
67+ name : config git
68+ command : |
69+ git config --global user.email "nobody@deriv.com"
70+ git config --global user.name "Nobody"
71+ - run :
72+ name : update schema
73+ command : |
74+ git clone https://github.com/binary-com/deriv-developers-portal.git /tmp/deriv-developers-portal
75+ curl -L https://cpanmin.us | perl - --sudo App::cpanminus
76+ sudo cpanm -n Dir::Self File::Basename JSON::MaybeXS Log::Any Path::Tiny Template Syntax::Keyword::Try
77+ BINARYCOM_API_SCHEMA_PATH=/tmp/deriv-developers-portal/config/v3 perl scripts/regen-py.pl
78+ if [[ $(git diff --shortstat) == ' 2 files changed, 2 insertions(+), 2 deletions(-)' ]]
79+ then
80+ echo 'Schema no change'
81+ exit 0
82+ fi
83+ echo "Schama updated"
84+ pip3 install bump
85+ NEXT_VER=$(bump)
86+ sed -i '/# Changelog/{s/$/\n\n## NEXTVER\n\nSync API/}' CHANGELOG.md
87+ sed -i "s/NEXTVER/$NEXT_VER/g" CHANGELOG.md
88+ git add .
89+ git commit -m 'update schema automatically'
90+ git push origin HEAD:master
91+ release :
92+ << : *default
93+ steps :
94+ - checkout
95+ - run :
96+ name : setup pypi
97+ command : |
98+ echo "[pypi]" >> ~/.pypirc
99+ echo "username=__token__" >> ~/.pypirc
100+ echo "password=$PYPI_TOKEN" >> ~/.pypirc
101+ - run :
102+ name : release
103+ command : |
104+ python3 -m pip install --upgrade twine
105+ make build
106+ python3 -m twine upload --repository pypi dist/*
107+ echo "deployed to pypi"
59108workflows :
60109 build :
61110 jobs :
@@ -78,7 +127,26 @@ workflows:
78127 - " 3.10.4"
79128 - " 3.10.10"
80129 - docs-build-deploy :
130+ requires :
131+ - release
132+ filters :
133+ branches :
134+ only :
135+ - master
136+ - release :
137+ requires :
138+ - test
139+ filters :
140+ branches :
141+ only :
142+ - master
143+ update_schema_flow :
144+ jobs :
145+ - update_schema
146+ triggers :
147+ - schedule :
148+ cron : " 0 0 * * *"
81149 filters :
82150 branches :
83151 only :
84- - master
152+ - master
0 commit comments