Skip to content

Merge pull request #589 from CUQI-DTU/make_restorator_more_robust #150

Merge pull request #589 from CUQI-DTU/make_restorator_more_robust

Merge pull request #589 from CUQI-DTU/make_restorator_more_robust #150

Workflow file for this run

name: Publish to PyPI and TestPyPI
on:
push:
branches:
- main
release:
types: [created]
jobs:
build-n-publish:
name: Build and publish to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history to determine version
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish pre-release to PyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to PyPI
if: github.event_name == 'release' && github.event.action == 'created' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
dispatch-tests: # This job will trigger the plugin tests workflow in the other repositories (waits for the previous job to finish and then 5 minutes)
name: Dispatch tests on downstream plugins after publishing to PyPI
needs: build-n-publish
strategy:
matrix:
repo: ['CUQI-DTU/CUQIpy-PyTorch', 'CUQI-DTU/CUQIpy-CIL', 'CUQI-DTU/CUQIpy-FEniCS']
runs-on: ubuntu-latest
steps:
- name: Sleep for 5 minutes
run: sleep 300s
shell: bash
- name: Dispatch tests on downstream plugins
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: ${{ matrix.repo }}
event-type: run-tests-on-cuqipy-update
client-payload: '{"event_name": "${{ github.event_name }}"}'