Skip to content

Commit

Permalink
Add testpypi
Browse files Browse the repository at this point in the history
  • Loading branch information
wvangeit committed Dec 27, 2023
1 parent 39870b6 commit c87bab9
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: build-wheel
on:
push:


jobs:
wheels:
name: Building wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }}
Expand All @@ -12,7 +11,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-20.04]
python: [cp38,cp39,cp310]
python: [cp38,cp39,cp310,cp311]
arch: [x86_64]

steps:
Expand All @@ -33,32 +32,42 @@ jobs:
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.arch }}
path: wheelhouse/*.whl
test-pypi:
name: Publish wheels on Test PyPI
runs-on: ubuntu-latest
needs:
- wheels
environment:
name: testpypi
url: https://test.pypi.org/p/itis-dakota
permissions:
id-token: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

pypi:
name: Publish wheels on PyPI
runs-on: ubuntu-latest
needs: [wheels]
needs:
- wheels
- publish-to-testpypi
if: github.ref == 'refs/heads/master'
environment:
name: pypi
url: https://pypi.org/p/itis-dakota
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Put artifacts into dist directory
run: |
mkdir -p dist
find artifacts -type f \( -iname \*.whl -o -iname \*.tar.gz \) -exec mv {} dist \;
path: dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit c87bab9

Please sign in to comment.