@@ -63,48 +63,12 @@ jobs:
63
63
64
64
- run : pip freeze
65
65
66
- - run : mkdir coverage
67
-
68
66
- run : make test
69
67
env :
70
- COVERAGE_FILE : coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-with-deps
71
68
CONTEXT : ${{ runner.os }}-py${{ matrix.python-version }}-with-deps
72
69
73
- - name : store coverage files
74
- uses : actions/upload-artifact@v3
75
- with :
76
- name : coverage
77
- path : coverage
78
-
79
- coverage-combine :
80
- needs : [test]
81
- runs-on : ubuntu-latest
82
-
83
- steps :
84
- - uses : actions/checkout@v3
85
-
86
- - uses : actions/setup-python@v4
87
- with :
88
- python-version : ' 3.8'
89
-
90
- - name : get coverage files
91
- uses : actions/download-artifact@v3
92
- with :
93
- name : coverage
94
- path : coverage
95
-
96
- - run : pip install coverage[toml]
97
-
98
- - run : ls -la coverage
99
- - run : coverage combine coverage
100
- - run : coverage report
101
- - run : coverage html --show-contexts --title "pydantic coverage for ${{ github.sha }}"
102
-
103
- - name : Store coverage html
104
- uses : actions/upload-artifact@v3
105
- with :
106
- name : coverage-html
107
- path : htmlcov
70
+ - run : coverage xml
71
+ - uses : codecov/codecov-action@v3
108
72
109
73
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
110
74
check :
@@ -117,11 +81,15 @@ jobs:
117
81
with :
118
82
jobs : ${{ toJSON(needs) }}
119
83
120
- deploy :
121
- name : Deploy
84
+ release :
85
+ name : Release
122
86
needs : [check]
123
87
if : " success() && startsWith(github.ref, 'refs/tags/')"
124
88
runs-on : ubuntu-latest
89
+ environment : release
90
+
91
+ permissions :
92
+ id-token : write
125
93
126
94
steps :
127
95
- uses : actions/checkout@v2
@@ -132,20 +100,15 @@ jobs:
132
100
python-version : ' 3.10'
133
101
134
102
- name : install
135
- run : pip install -U twine build
103
+ run : pip install -U build
136
104
137
105
- name : check GITHUB_REF matches package version
138
- uses : samuelcolvin/check-python-version@v3
106
+ uses : samuelcolvin/check-python-version@v3.1
139
107
with :
140
108
version_file_path : pydantic_extra_types/__init__.py
141
109
142
110
- name : build
143
111
run : python -m build
144
112
145
- - run : twine check --strict dist/*
146
-
147
- - name : upload to pypi
148
- run : twine upload dist/*
149
- env :
150
- TWINE_USERNAME : __token__
151
- TWINE_PASSWORD : ${{ secrets.pypi_token }}
113
+ - name : Upload package to PyPI
114
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments