Skip to content

Commit

Permalink
Add pypi build and publish to CD
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed Sep 12, 2023
1 parent 6a1d1de commit f4c142a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,37 @@ jobs:
user: accessnri
label: main
token: ${{ secrets.anaconda_token }}

pypi-build:
name: Build package for PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: 3.11

- run: |
python3 -m pip install --upgrade build && python3 -m build
- uses: actions/upload-artifact@v3
with:
path: ./dist

pypi-publish:
# Split build and publish to restrict trusted publishing to just this workflow
needs: ['pypi-build']
name: Publish to PyPI.org
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3

- name: Publish package distributions to PyPI
# This is version v1.8.10
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
with:
packages_dir: artifact/

0 comments on commit f4c142a

Please sign in to comment.