test if statement #11
Workflow file for this run
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: Build and publish python wheels | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- ci/python-ci | |
tags: | |
- '*' | |
jobs: | |
build-publish: | |
name: Build and publish wheels | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: | |
- 'quantinuum-hugr-py' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python '3.10' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: "poetry" | |
- name: Build sdist and wheels | |
run: | | |
cd ${{ matrix.package }} | |
poetry build -o ../dist | |
- name: Upload the built packages as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.package }}-sdist | |
path: | | |
dist/*.tar.gz | |
dist/*.whl | |
- name: Publish to test instance of PyPI | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, format('refs/tags/{}-v', matrix.package)) }} | |
run: | | |
echo "Event name is ${{ github.event_name }}" | |
echo "Ref type is ${{ github.ref_type }}" | |
echo "Ref is ${{ github.ref }}" | |
cd ${{ matrix.package }} | |
poetry config repositories.test-pypi https://test.pypi.org/legacy/ | |
poetry config pypi-token.test-pypi ${{ secrets.PYPI_TEST_PUBLISH }} | |
poetry publish -r test-pypi --dist-dir ../dist --skip-existing |