Skip to content

Commit

Permalink
Temporary update cd.yml to source-only upload to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
iainrussell authored Sep 25, 2024
1 parent 82edec0 commit 9a4053a
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,38 @@ on:
paths:
- '.github/workflows/cd.yml'
jobs:
wheel-linux:
uses: ./.github/workflows/build-wheel-linux.yml
secrets: inherit
wheel-macos:
uses: ./.github/workflows/build-wheel-macos.yml
secrets: inherit
pypi:
needs: [wheel-linux, wheel-macos]
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
secrets: inherit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish to pypi
if: ${{ !inputs.testpypi }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*
- name: Build and publish to testpypi
if: ${{ inputs.testpypi }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
run: |
python -m build
twine upload --repository testpypi dist/*

0 comments on commit 9a4053a

Please sign in to comment.