@@ -4,12 +4,12 @@ name: Python package
44
55on :
66 push :
7- branches : [ "main","feature/**","development", "[0-9]+-*"]
7+ branches : ["main", "feature/**", "development", "[0-9]+-*"]
88 tags :
99 - v[0-9]+.[0-9]+.[0-9]+*
1010 pull_request :
11- branches : [ "main","development"]
12- types : [opened, reopened, edited]
11+ branches : ["main", "development"]
12+ types : [opened, reopened, edited, synchronize ]
1313
1414jobs :
1515 test-and-lint :
@@ -21,85 +21,83 @@ jobs:
2121 python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
2222
2323 steps :
24- - uses : actions/checkout@v4
25- - name : Set up Python ${{ matrix.python-version }}
26- uses : actions/setup-python@v5
27- with :
28- python-version : ${{ matrix.python-version }}
29- cache : ' pip'
30- cache-dependency-path : |
31- **/requirements*.txt
32-
33- - name : Install dependencies
34- run : |
35- python -m pip install --upgrade pip
36- python -m pip install .[test,tox_gh,tox,mypy,flake8]
37-
38- # Linting step only runs for Python 3.8
39- - name : mypy
40- if : matrix.python-version == '3.8'
41- continue-on-error : true
42- run : mypy -p corbado_python_sdk --exclude generated --strict --disable-error-code attr-defined
43- - name : lint with flake8
44- if : matrix.python-version == '3.8'
45- run : flake8 .
46-
47- - name : Test with tox
48- run : |
49- tox run
50- env :
51- CORBADO_PROJECT_ID : ${{ secrets. CORBADO_PROJECT_ID }}
52- CORBADO_API_SECRET : ${{ secrets.CORBADO_API_SECRET }}
53- CORBADO_FRONTEND_API : ${{ vars.CORBADO_FRONTEND_API }}
54- CORBADO_BACKEND_API : ${{ vars.CORBADO_BACKEND_API }}
24+ - uses : actions/checkout@v4
25+ - name : Set up Python ${{ matrix.python-version }}
26+ uses : actions/setup-python@v5
27+ with :
28+ python-version : ${{ matrix.python-version }}
29+ cache : " pip"
30+ cache-dependency-path : |
31+ **/requirements*.txt
32+
33+ - name : Install dependencies
34+ run : |
35+ python -m pip install --upgrade pip
36+ python -m pip install .[test,tox_gh,tox,mypy,flake8]
37+
38+ # Linting step only runs for Python 3.8
39+ - name : mypy
40+ if : matrix.python-version == '3.8'
41+ continue-on-error : true
42+ run : mypy -p corbado_python_sdk --exclude generated --strict --disable-error-code attr-defined
43+ - name : lint with flake8
44+ if : matrix.python-version == '3.8'
45+ run : flake8 .
46+
47+ - name : Test with tox
48+ run : |
49+ tox run
50+ env :
51+ CORBADO_PROJECT_ID : " pro-1870103272253508163 "
52+ CORBADO_API_SECRET : ${{ secrets.CORBADO_API_SECRET }}
53+ CORBADO_FRONTEND_API : ${{ vars.CORBADO_FRONTEND_API }}
54+ CORBADO_BACKEND_API : ${{ vars.CORBADO_BACKEND_API }}
5555
56-
57-
5856 build :
59- if : startsWith(github.ref, 'refs/tags/v') # only make separate build and upload for tag pushes
60- name : Build and upload distribution package
57+ if : startsWith(github.ref, 'refs/tags/v') # only make separate build and upload for tag pushes
58+ name : Build and upload distribution package
6159 runs-on : ubuntu-latest
6260
6361 steps :
64- - uses : actions/checkout@v4
65- - name : Set up Python
66- uses : actions/setup-python@v5
67- with :
68- python-version : " 3.12"
69-
70- - name : Install pypa/build
71- run : >-
72- python3 -m
73- pip install
74- build
75- --user
76-
77- - name : Build a binary wheel and a source tarball
78- run : python3 -m build
79-
80- - name : Store the distribution packages
81- uses : actions/upload-artifact@v4
82- with :
83- name : python-package-distributions
84- path : dist/
62+ - uses : actions/checkout@v4
63+ - name : Set up Python
64+ uses : actions/setup-python@v5
65+ with :
66+ python-version : " 3.12"
67+
68+ - name : Install pypa/build
69+ run : >-
70+ python3 -m
71+ pip install
72+ build
73+ --user
74+
75+ - name : Build a binary wheel and a source tarball
76+ run : python3 -m build
77+
78+ - name : Store the distribution packages
79+ uses : actions/upload-artifact@v4
80+ with :
81+ name : python-package-distributions
82+ path : dist/
8583
8684 publish-to-pypi :
8785 name : >-
8886 Publish Python distribution package to PyPI
89- if : startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes
90- needs : [build,test-and-lint] # Ensure that package was built and tested for all python versions before publishing
87+ if : startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes
88+ needs : [build, test-and-lint] # Ensure that package was built and tested for all python versions before publishing
9189 runs-on : ubuntu-latest
9290 environment :
9391 name : pypi
9492 url : https://pypi.org/p/passkeys
9593 permissions :
96- id-token : write
94+ id-token : write
9795
9896 steps :
99- - name : Download all the dists
100- uses : actions/download-artifact@v4
101- with :
102- name : python-package-distributions
103- path : dist/
104- - name : Publish distribution package to PyPI
105- uses : pypa/gh-action-pypi-publish@release/v1
97+ - name : Download all the dists
98+ uses : actions/download-artifact@v4
99+ with :
100+ name : python-package-distributions
101+ path : dist/
102+ - name : Publish distribution package to PyPI
103+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments