Skip to content

Commit 1e0c800

Browse files
committed
fix: separate the deploy workflow
1 parent 131dbbd commit 1e0c800

File tree

2 files changed

+47
-50
lines changed

2 files changed

+47
-50
lines changed

.github/workflows/CD.yml

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -221,53 +221,4 @@ jobs:
221221
manifest-file: ".release-please-manifest.json"
222222
outputs:
223223
release_created: ${{ steps.release.outputs.release_created }}
224-
#if a release is created then run the deploy scripts for github.io, conda, pypi and docker
225-
226-
conda-upload:
227-
needs: [conda-build]
228-
if: github.ref == 'refs/heads/master'
229-
runs-on: ${{matrix.os}}
230-
strategy:
231-
fail-fast: false
232-
matrix:
233-
os:
234-
- ubuntu-latest
235-
# - macos-latest
236-
- windows-latest
237-
python-version: ["3.9", "3.10", "3.11", "3.12"]
238-
# if: ${{ needs.release-please.outputs.release_created }}
239-
steps:
240-
- uses: actions/download-artifact@v4
241-
with:
242-
name: map2loop-conda-${{ matrix.os }}-${{ matrix.python-version }}
243-
path: conda
244-
- uses: conda-incubator/setup-miniconda@v3
245-
- name: upload all files to conda-forge
246-
shell: bash -l {0}
247-
env:
248-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
249-
with:
250-
skip-existing: true
251-
verbose: true
252-
run: |
253-
conda install -c anaconda anaconda-client -y
254-
anaconda upload --label main conda/*/*.tar.bz2
255-
256-
pypi-upload:
257-
if: github.ref == 'refs/heads/master'
258-
needs: [pypi-test-wheels]
259-
runs-on:
260-
- ubuntu-latest
261-
# if: ${{ needs.release-please.outputs.release_created }}
262-
permissions:
263-
# IMPORTANT: this permission is mandatory for trusted publishing
264-
id-token: write
265-
steps:
266-
- uses: actions/download-artifact@v4
267-
with:
268-
name: map2loop-dist
269-
path: dist/
270-
- uses: pypa/gh-action-pypi-publish@release/v1
271-
with:
272-
skip-existing: true
273-
verbose: true
224+
#if a release is created then run the deploy scripts for github.io, conda, pypi and docker

.github/workflows/deployment.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- release-please
7+
types:
8+
- completed
9+
10+
jobs:
11+
conda-upload:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- windows-latest
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
steps:
21+
- uses: actions/download-artifact@v4
22+
with:
23+
name: map2loop-conda-${{ matrix.os }}-${{ matrix.python-version }}
24+
path: conda
25+
- uses: conda-incubator/setup-miniconda@v3
26+
- name: Upload to Conda
27+
shell: bash -l {0}
28+
env:
29+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
30+
run: |
31+
conda install -c anaconda anaconda-client -y
32+
anaconda upload --label main conda/*/*.tar.bz2
33+
34+
pypi-upload:
35+
runs-on: ubuntu-latest
36+
permissions:
37+
id-token: write # Required for PyPI
38+
steps:
39+
- uses: actions/download-artifact@v4
40+
with:
41+
name: map2loop-dist
42+
path: dist/
43+
- uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
skip-existing: true
46+
verbose: true

0 commit comments

Comments
 (0)