Fix TestPyPI test #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python π distributions π¦ to PyPI and TestPyPI | |
on: | |
push: | |
branches: | |
- release/test-uploaded | |
- release/test | |
- release/main | |
workflow_dispatch: | |
jobs: | |
publish-to-testpypi: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install setuptools and wheel | |
run: | | |
python -m pip install --user setuptools wheel | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python setup.py bdist_wheel | |
python setup.py sdist | |
# TODO: switch to pep517 | |
- name: Publish distribution π¦ to Test PyPI | |
if: >- | |
(github.ref == 'refs/heads/release/test') || | |
(github.ref == 'refs/heads/release/main') | |
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f # v1.5.1 | |
with: | |
password: ${{ secrets.test_pypi_password }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
test-uploaded: | |
needs: publish-to-testpypi | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
with: | |
version: '1.6' | |
- name: Install tox | |
run: python -m pip install --user tox | |
- run: cd ci/test-upload && python -m tox | |
publish-to-pypi: | |
needs: test-uploaded | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: # using `matrix` to define a constant | |
package: ['julia==0.6.2'] | |
steps: | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install setuptools and wheel | |
run: | | |
python -m pip install --user setuptools wheel | |
- name: Download from TestPyPI | |
run: | | |
pip download --dest dist --no-deps --index-url https://test.pypi.org/simple/ ${{ matrix.package }} | |
pip download --dest dist --no-deps --index-url https://test.pypi.org/simple/ ${{ matrix.package }} --no-binary :all: | |
- run: ls -lh dist | |
- name: Publish distribution π¦ to PyPI | |
if: github.ref == 'refs/heads/release/main' | |
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f # v1.5.1 | |
with: | |
password: ${{ secrets.pypi_password }} |