-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (57 loc) · 1.77 KB
/
python-sdk.yml
File metadata and controls
70 lines (57 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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