publish-python-client #266
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-client | |
on: | |
workflow_run: | |
workflows: [build-and-test-python-client] | |
branches: [master] | |
types: | |
- completed | |
permissions: read-all | |
jobs: | |
publish-osparc_client: | |
name: Publish osparc_client wheel | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/osparc_client | |
permissions: | |
id-token: write | |
steps: | |
- name: Download wheels | |
run: gh run download ${{ github.event.workflow_run.id }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Remove osparc wheel | |
run: | | |
osparc_wheel=$(ls osparc_python_wheels/osparc-*) | |
rm -f ${osparc_wheel} | |
- name: Publish osparc_client to Test PyPI | |
if: github.event_name == 'push' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
packages-dir: osparc_python_wheels/ | |
- name: Publish osparc_client to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
packages-dir: osparc_python_wheels/ | |
publish-osparc: | |
name: Publish osparc wheel | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/osparc | |
permissions: | |
id-token: write | |
steps: | |
- name: Download wheels | |
run: gh run download ${{ github.event.workflow_run.id }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Remove osparc_client wheel | |
run: | | |
osparc_client_wheel=$(ls osparc_python_wheels/osparc_client*) | |
rm -f ${osparc_client_wheel} | |
- name: Publish osparc to Test PyPI | |
if: github.event_name == 'push' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
packages-dir: osparc_python_wheels/ | |
- name: Publish osparc to PyPI | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
packages-dir: osparc_python_wheels/ |