File tree Expand file tree Collapse file tree 5 files changed +2517
-0
lines changed Expand file tree Collapse file tree 5 files changed +2517
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to PyPi
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Test package"]
6+ types :
7+ - completed
8+ branches :
9+ - main
10+ status :
11+ - success
12+
13+ jobs :
14+ publish :
15+
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - uses : actions/checkout@v4
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v4
23+ with :
24+ python-version : ' 3.11'
25+
26+ - name : Install dependencies
27+ run : |
28+ python -m pip install --upgrade pip
29+ pip install build twine wheel scmver setuptools
30+
31+ - name : Get version from setup.py
32+ id : version
33+ run : |
34+ version=$(python3 setup.py --version)
35+ echo "version=$version" >> $GITHUB_ENV
36+
37+ - name : Build package
38+ run : python setup.py sdist bdist_wheel
39+
40+ - name : Publish package
41+ 42+ with :
43+ user : __token__
44+ password : ${{ secrets.PYPI_API_TOKEN }}
45+
46+ - name : Create and push tag
47+ run : |
48+ git tag v$version
49+ git push origin v$version
50+ env :
51+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Test package
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ test :
7+
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - uses : actions/checkout@v4
12+
13+ - name : Set up Python
14+ uses : actions/setup-python@v4
15+ with :
16+ python-version : ' 3.11'
17+
18+ - name : Install dependencies
19+ run : |
20+ python -m pip install --upgrade pip
21+ pip install build twine wheel scmver setuptools
22+
23+ - name : Get version from setup.py
24+ id : version
25+ run : |
26+ version=$(python3 setup.py --version)
27+ echo "version=$version" >> $GITHUB_ENV
28+
29+ - name : Build package
30+ run : python setup.py sdist bdist_wheel
31+
32+ - name : Install package
33+ run : pip install dist/scaleway_qaas_client-${version}-py3-none-any.whl
34+
35+ - name : Install test
36+ run : pip install -r tests/requirements.txt
37+
38+ - name : Run test
39+ run : pytest -s --showprogress -vv tests/
40+ env :
41+ SCALEWAY_PROJECT_ID : ${{ secrets.STG_SCALEWAY_PROJECT_ID }}
42+ SCALEWAY_API_TOKEN : ${{ secrets.STG_SCALEWAY_API_TOKEN }}
43+ SCALEWAY_API_URL : ${{ secrets.STG_SCALEWAY_API_URL }}
You can’t perform that action at this time.
0 commit comments