Skip to content

PyPi

PyPi #2

Workflow file for this run

name: PyPi
on:
workflow_run:
workflows: ["Build"]
types: [completed]
workflow_dispatch:
jobs:
pypi-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v') }}
environment:
name: pypi
url: https://pypi.org/p/pycnn
permissions:
id-token: write
actions: read
contents: read
steps:
- name: Download artifacts from Build workflow
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: artifacts
- name: Organize dist files
run: |
mkdir -p dist
find artifacts -name "*.whl" -exec cp {} dist/ \;
find artifacts -name "*.tar.gz" -exec cp {} dist/ \;
ls -la dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/