revamp #277
This file contains hidden or 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: Python SDK release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| skip-test: | |
| description: 'Skip test' | |
| required: false | |
| type: string | |
| default: "false" | |
| jobs: | |
| pip: | |
| name: Publish to Pip | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./python-sdk | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python 3.9 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9.23" | |
| - name: Install pypa/build | |
| run: python -m pip install build --user | |
| - name: Install deps | |
| run: pip install -r requirements.txt | |
| - name: Install tests deps | |
| run: pip install -r test-requirements.txt | |
| - name: GCP - Auth with github service account | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
| - name: configure docker access to GCP registry for EE image | |
| run: gcloud auth configure-docker europe-west1-docker.pkg.dev | |
| - name: Test with pytest | |
| env: | |
| APPLICATION_SECRETS: ${{ secrets.APPLICATION_SECRETS }} | |
| run: | | |
| echo $APPLICATION_SECRETS | base64 -d > ../test-utils/docker-setup/application-secrets.yml | |
| ./run-tests.sh | |
| - name: Build a binary wheel and a source tarball | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| run: python -m build --sdist --wheel --outdir dist/ . | |
| - name: Publish distribution to PyPI | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| verbose: true | |
| packages-dir: python-sdk/dist |