Skip to content

Commit

Permalink
Merge 8b44917 into 6a1d1de
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed Sep 14, 2023
2 parents 6a1d1de + 8b44917 commit e9876b4
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -31,3 +31,41 @@ jobs:
user: accessnri
label: main
token: ${{ secrets.anaconda_token }}

pypi-build:
name: Build package for PyPI
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
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
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
path: artifact/

- 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 e9876b4

Please sign in to comment.