Skip to content

Commit f1d1fe8

Browse files
committed
Adding PyPi
1 parent 04164d2 commit f1d1fe8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/pypi.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
name: PyPi
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_run:
5+
workflows: ["Build"]
6+
types: [completed]
67
workflow_dispatch:
78

89
jobs:
910
pypi-publish:
1011
name: Publish to PyPI
1112
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v') }}
1214
environment:
1315
name: pypi
1416
url: https://pypi.org/p/pycnn
1517
permissions:
1618
id-token: write
19+
actions: read
20+
contents: read
1721

1822
steps:
19-
- name: Download all artifacts
23+
- name: Download artifacts from Build workflow
2024
uses: actions/download-artifact@v4
2125
with:
26+
run-id: ${{ github.event.workflow_run.id }}
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
2228
path: artifacts
2329

2430
- name: Organize dist files
2531
run: |
2632
mkdir -p dist
27-
# We only need the wheels and sdist.
28-
# We can find them in the 'dist-*' artifacts created by build-wheels.yml
2933
find artifacts -name "*.whl" -exec cp {} dist/ \;
3034
find artifacts -name "*.tar.gz" -exec cp {} dist/ \;
3135
ls -la dist/

0 commit comments

Comments
 (0)