Skip to content

Commit

Permalink
test [pypi]
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Jun 7, 2024
1 parent f6af2ab commit fbb3027
Showing 1 changed file with 58 additions and 59 deletions.
117 changes: 58 additions & 59 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Wheels

on: [ push, pull_request ]


jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
Expand Down Expand Up @@ -76,61 +75,61 @@ jobs:
wheelhouse/*.whl
build-sdist-and-upload:
runs-on: ubuntu-latest
needs: ['build_wheels']
environment: wheels
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: "setup.py"

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U build twine
- name: Download wheels from build artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist-wheels/

- name: Build package
run: |
python -m build --sdist
twine check --strict dist/*
twine check --strict dist-wheels/*
- name: Publish wheels to PyPI Test
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist-wheels/

- name: Publish sdist to PyPI Test
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish wheels to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist-wheels/

- name: Publish sdist to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
runs-on: ubuntu-latest
needs: [ 'build_wheels' ]
environment: wheels
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: "setup.py"

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U build twine
- name: Download wheels from build artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist-wheels/

- name: Build package
run: |
python -m build --sdist
twine check --strict dist/*
twine check --strict dist-wheels/*
- name: Publish wheels to PyPI Test
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist-wheels/

- name: Publish sdist to PyPI Test
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish wheels to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist-wheels/

- name: Publish sdist to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit fbb3027

Please sign in to comment.