@@ -4,12 +4,12 @@ name: Python package
4
4
5
5
on :
6
6
push :
7
- branches : [ "main","feature/**","development", "[0-9]+-*"]
7
+ branches : ["main", "feature/**", "development", "[0-9]+-*"]
8
8
tags :
9
9
- v[0-9]+.[0-9]+.[0-9]+*
10
10
pull_request :
11
- branches : [ "main","development"]
12
- types : [opened, reopened, edited]
11
+ branches : ["main", "development"]
12
+ types : [opened, reopened, edited, synchronize ]
13
13
14
14
jobs :
15
15
test-and-lint :
@@ -21,85 +21,83 @@ jobs:
21
21
python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
22
22
23
23
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 }}
55
55
56
-
57
-
58
56
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
61
59
runs-on : ubuntu-latest
62
60
63
61
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/
85
83
86
84
publish-to-pypi :
87
85
name : >-
88
86
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
91
89
runs-on : ubuntu-latest
92
90
environment :
93
91
name : pypi
94
92
url : https://pypi.org/p/passkeys
95
93
permissions :
96
- id-token : write
94
+ id-token : write
97
95
98
96
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