@@ -33,16 +33,18 @@ jobs:
33
33
34
34
steps :
35
35
- uses : actions/checkout@v4
36
+ - uses : actions/setup-python@v4
37
+ with :
38
+ python-version : 3.x
36
39
- name : Install conda-merge
37
40
run : |
38
- $CONDA/bin/ python -m pip install conda-merge
41
+ python -m pip install conda-merge
39
42
- name : Combine environments
40
43
run : |
41
44
for SUFFIX in ci integration; do
42
- $CONDA/bin/ conda-merge ci/environment-$SUFFIX.yml environment.yml > ci/combined-environment-$SUFFIX.yml || exit
45
+ conda-merge ci/environment-$SUFFIX.yml environment.yml > ci/combined-environment-$SUFFIX.yml || exit
43
46
done
44
- - name : Archive combined environments
45
- uses : actions/upload-artifact@v3
47
+ - uses : actions/upload-artifact@v3
46
48
with :
47
49
name : combined-environments
48
50
path : ci/combined-environment-*.yml
@@ -57,17 +59,20 @@ jobs:
57
59
58
60
steps :
59
61
- uses : actions/checkout@v4
60
- - name : Download combined environments
61
- uses : actions/download-artifact@v3
62
+ - uses : actions/download-artifact@v3
62
63
with :
63
64
name : combined-environments
64
65
path : ci
65
- - name : Install Conda environment with Micromamba
66
- uses : mamba-org/setup-micromamba@v1
66
+ - name : Get current date
67
+ id : date
68
+ run : echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
69
+ - uses : mamba-org/setup-micromamba@v1
67
70
with :
68
71
environment-file : ci/combined-environment-ci.yml
69
72
environment-name : DEVELOP
70
73
cache-environment : true
74
+ cache-environment-key : environment-${{ steps.date.outputs.date }}
75
+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
71
76
create-args : >-
72
77
python=${{ matrix.python-version }}
73
78
- name : Install package
@@ -83,17 +88,20 @@ jobs:
83
88
84
89
steps :
85
90
- uses : actions/checkout@v4
86
- - name : Download combined environments
87
- uses : actions/download-artifact@v3
91
+ - uses : actions/download-artifact@v3
88
92
with :
89
93
name : combined-environments
90
94
path : ci
91
- - name : Install Conda environment with Micromamba
92
- uses : mamba-org/setup-micromamba@v1
95
+ - name : Get current date
96
+ id : date
97
+ run : echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
98
+ - uses : mamba-org/setup-micromamba@v1
93
99
with :
94
100
environment-file : ci/combined-environment-ci.yml
95
101
environment-name : DEVELOP
96
102
cache-environment : true
103
+ cache-environment-key : environment-${{ steps.date.outputs.date }}
104
+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
97
105
create-args : >-
98
106
python=3.10
99
107
- name : Install package
@@ -109,17 +117,20 @@ jobs:
109
117
110
118
steps :
111
119
- uses : actions/checkout@v4
112
- - name : Download combined environments
113
- uses : actions/download-artifact@v3
120
+ - uses : actions/download-artifact@v3
114
121
with :
115
122
name : combined-environments
116
123
path : ci
117
- - name : Install Conda environment with Micromamba
118
- uses : mamba-org/setup-micromamba@v1
124
+ - name : Get current date
125
+ id : date
126
+ run : echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
127
+ - uses : mamba-org/setup-micromamba@v1
119
128
with :
120
129
environment-file : ci/combined-environment-ci.yml
121
130
environment-name : DEVELOP
122
131
cache-environment : true
132
+ cache-environment-key : environment-${{ steps.date.outputs.date }}
133
+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
123
134
create-args : >-
124
135
python=3.10
125
136
- name : Install package
@@ -145,17 +156,20 @@ jobs:
145
156
146
157
steps :
147
158
- uses : actions/checkout@v4
148
- - name : Download combined environments
149
- uses : actions/download-artifact@v3
159
+ - uses : actions/download-artifact@v3
150
160
with :
151
161
name : combined-environments
152
162
path : ci
153
- - name : Install Conda environment with Micromamba
154
- uses : mamba-org/setup-micromamba@v1
163
+ - name : Get current date
164
+ id : date
165
+ run : echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
166
+ - uses : mamba-org/setup-micromamba@v1
155
167
with :
156
168
environment-file : ci/combined-environment${{ matrix.extra }}.yml
157
169
environment-name : DEVELOP${{ matrix.extra }}
158
170
cache-environment : true
171
+ cache-environment-key : environment-${{ steps.date.outputs.date }}
172
+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
159
173
create-args : >-
160
174
python=${{ matrix.python-version }}
161
175
- name : Install package
@@ -168,11 +182,6 @@ jobs:
168
182
distribution :
169
183
runs-on : ubuntu-latest
170
184
needs : [unit-tests, type-check, docs-build, integration-tests]
171
- environment :
172
- name : pypi
173
- url : https://pypi.org/p/ogc-api-processes-fastapi
174
- permissions :
175
- id-token : write # IMPORTANT: this permission is mandatory for trusted publish
176
185
if : |
177
186
always() &&
178
187
needs.unit-tests.result == 'success' &&
@@ -182,18 +191,47 @@ jobs:
182
191
183
192
steps :
184
193
- uses : actions/checkout@v4
185
- - name : Install packages
194
+ - uses : actions/setup-python@v4
195
+ with :
196
+ python-version : ' 3.10'
197
+ - name : Install package
186
198
run : |
187
- $CONDA/bin/python -m pip install build twine
188
- - name : Build distributions
199
+ python -m pip install --upgrade pip
200
+ python -m pip install build twine
201
+ - name : Build distribution
189
202
run : |
190
- $CONDA/bin/ python -m build
203
+ python -m build
191
204
- name : Check wheels
192
205
run : |
193
206
cd dist || exit
194
- $CONDA/bin/python -m pip install ogc_api_processes_fastapi*.whl || exit
195
- $CONDA/bin/python -m twine check * || exit
196
- $CONDA/bin/python -c "import ogc_api_processes_fastapi"
197
- - name : Publish a Python distribution to PyPI
198
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
199
- uses : pypa/gh-action-pypi-publish@release/v1
207
+ python -m pip install ogc_api_processes_fastapi*.whl || exit
208
+ python -m twine check --strict * || exit
209
+ python -c "import ogc_api_processes_fastapi" || exit
210
+ cd ..
211
+ - uses : actions/upload-artifact@v3
212
+ with :
213
+ name : distribution
214
+ path : dist
215
+
216
+ upload-to-pypi :
217
+ runs-on : ubuntu-latest
218
+ needs : distribution
219
+ if : |
220
+ always() &&
221
+ needs.distribution.result == 'success' &&
222
+ github.event_name == 'push' &&
223
+ startsWith(github.ref, 'refs/tags')
224
+ environment :
225
+ name : pypi
226
+ url : https://pypi.org/p/ogc-api-processes-fastapi
227
+ permissions :
228
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publish
229
+
230
+ steps :
231
+ - uses : actions/download-artifact@v3
232
+ with :
233
+ name : distribution
234
+ path : dist
235
+
236
+ with :
237
+ verbose : true
0 commit comments