@@ -33,16 +33,18 @@ jobs:
3333
3434 steps :
3535 - uses : actions/checkout@v4
36+ - uses : actions/setup-python@v4
37+ with :
38+ python-version : 3.x
3639 - name : Install conda-merge
3740 run : |
38- $CONDA/bin/ python -m pip install conda-merge
41+ python -m pip install conda-merge
3942 - name : Combine environments
4043 run : |
4144 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
4346 done
44- - name : Archive combined environments
45- uses : actions/upload-artifact@v3
47+ - uses : actions/upload-artifact@v3
4648 with :
4749 name : combined-environments
4850 path : ci/combined-environment-*.yml
@@ -57,17 +59,20 @@ jobs:
5759
5860 steps :
5961 - uses : actions/checkout@v4
60- - name : Download combined environments
61- uses : actions/download-artifact@v3
62+ - uses : actions/download-artifact@v3
6263 with :
6364 name : combined-environments
6465 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
6770 with :
6871 environment-file : ci/combined-environment-ci.yml
6972 environment-name : DEVELOP
7073 cache-environment : true
74+ cache-environment-key : environment-${{ steps.date.outputs.date }}
75+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
7176 create-args : >-
7277 python=${{ matrix.python-version }}
7378 - name : Install package
@@ -83,17 +88,20 @@ jobs:
8388
8489 steps :
8590 - uses : actions/checkout@v4
86- - name : Download combined environments
87- uses : actions/download-artifact@v3
91+ - uses : actions/download-artifact@v3
8892 with :
8993 name : combined-environments
9094 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
9399 with :
94100 environment-file : ci/combined-environment-ci.yml
95101 environment-name : DEVELOP
96102 cache-environment : true
103+ cache-environment-key : environment-${{ steps.date.outputs.date }}
104+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
97105 create-args : >-
98106 python=3.10
99107 - name : Install package
@@ -109,17 +117,20 @@ jobs:
109117
110118 steps :
111119 - uses : actions/checkout@v4
112- - name : Download combined environments
113- uses : actions/download-artifact@v3
120+ - uses : actions/download-artifact@v3
114121 with :
115122 name : combined-environments
116123 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
119128 with :
120129 environment-file : ci/combined-environment-ci.yml
121130 environment-name : DEVELOP
122131 cache-environment : true
132+ cache-environment-key : environment-${{ steps.date.outputs.date }}
133+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
123134 create-args : >-
124135 python=3.10
125136 - name : Install package
@@ -145,17 +156,20 @@ jobs:
145156
146157 steps :
147158 - uses : actions/checkout@v4
148- - name : Download combined environments
149- uses : actions/download-artifact@v3
159+ - uses : actions/download-artifact@v3
150160 with :
151161 name : combined-environments
152162 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
155167 with :
156168 environment-file : ci/combined-environment${{ matrix.extra }}.yml
157169 environment-name : DEVELOP${{ matrix.extra }}
158170 cache-environment : true
171+ cache-environment-key : environment-${{ steps.date.outputs.date }}
172+ cache-downloads-key : downloads-${{ steps.date.outputs.date }}
159173 create-args : >-
160174 python=${{ matrix.python-version }}
161175 - name : Install package
@@ -168,11 +182,6 @@ jobs:
168182 distribution :
169183 runs-on : ubuntu-latest
170184 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
176185 if : |
177186 always() &&
178187 needs.unit-tests.result == 'success' &&
@@ -182,18 +191,47 @@ jobs:
182191
183192 steps :
184193 - 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
186198 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
189202 run : |
190- $CONDA/bin/ python -m build
203+ python -m build
191204 - name : Check wheels
192205 run : |
193206 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