Skip to content

TSPS-367 fix: choose checkout-ref and tags based on github event type #41

TSPS-367 fix: choose checkout-ref and tags based on github event type

TSPS-367 fix: choose checkout-ref and tags based on github event type #41

name: Build and publish Python client to PyPI
on:
pull_request:
workflow_call:
inputs:
python-version:
required: true
type: string
checkout-ref:
required: true
type: string
jobs:
build-and-publish:

Check failure on line 14 in .github/workflows/release-python-client.yml

View workflow run for this annotation

GitHub Actions / Build and publish Python client to PyPI

Invalid workflow file

The workflow is not valid. .github/workflows/release-python-client.yml (Line: 14, Col: 3): The workflow must contain at least one job with no dependencies.
name: Build and publish Python client to PyPI
needs: [ params-gen ]
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing (OIDC)
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.checkout-ref }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install openapi-generator-cli
run: npm install @openapitools/openapi-generator-cli -g
- name: set version to 7.9.0
run: openapi-generator-cli version-manager set 7.9.0
- name: Generate Python client
run: |
echo "Generating Python client for version ${{ github.event.inputs.python-version }}"
openapi-generator-cli generate \
-i common/openapi.yml \
-g python \
-o teaspoons-client \
--additional-properties=projectName=terra-scientific-pipelines-service-api-client,packageName=teaspoons_client,packageVersion=${{ github.event.inputs.python-version }},httpUserAgent=terra-scientific-pipelines-service-api-client/${{ github.event.inputs.python-version }}/python
- name: Install pypa/build
working-directory: ./teaspoons-client
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
working-directory: ./teaspoons-client
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: ./teaspoons-client/dist
skip_existing: true
attestations: false # https://github.com/pypa/gh-action-pypi-publish/discussions/255