-
Notifications
You must be signed in to change notification settings - Fork 446
79 lines (70 loc) · 2.51 KB
/
python-api-client.yaml
File metadata and controls
79 lines (70 loc) · 2.51 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
71
72
73
74
75
76
77
78
79
name: python-api-client
on:
release:
types: [released]
workflow_dispatch:
inputs:
tag:
description: Tag/version to publish
required: true
skip_publish_pypi:
description: Skip publishing to PyPI
required: false
default: 'false'
jobs:
deploy:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
# Extract the version to 'version' based on workflow_dispatch or triggered tag in the published event
- name: Extract version
shell: bash
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "tag=$(echo ${{ github.event.inputs.tag }} | sed s/^v//)" >> $GITHUB_OUTPUT
else
echo "tag=$(echo ${GITHUB_REF##*/} | sed s/^v//)" >> $GITHUB_OUTPUT
fi
id: version
- name: Python build and make package
run: make package-python-sdk PACKAGE_VERSION=${{ steps.version.outputs.tag }}
- name: Python SDK publish package
if: ${{ inputs.skip_publish_pypi != 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: clients/python/dist/
verbose: true
- name: Extract docs version
shell: bash
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "tag=$(echo ${{ github.event.inputs.tag }} | cut -d. -f1-2)" >> $GITHUB_OUTPUT
else
echo "tag=$(echo ${GITHUB_REF##*/} | cut -d. -f1-2)" >> $GITHUB_OUTPUT
fi
id: docver
- name: Setup Ruby
uses: ruby/setup-ruby@v1.300.0
with:
working-directory: clients/python
ruby-version: '3.2'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build release as latest
working-directory: clients/python
run: bundle exec jekyll build -d _site -b /
- name: Build release ${{ steps.docver.outputs.tag }}
working-directory: clients/python
run: bundle exec jekyll build -d _site/${{ steps.docver.outputs.tag }} -b /${{ steps.docver.outputs.tag }}
- name: Publish to docs repository
uses: dmnemec/copy_file_to_another_repo_action@v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.TREEVERSE_CI_TOKEN }}
with:
source_file: clients/python/_site/.
destination_repo: treeverse/docs-lakefs-sdk-python
destination_folder: /
user_email: 'support@treeverse.io'
user_name: 'python-docs-action'