v1.3.1 #130
Workflow file for this run
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: python-api-client | |
on: | |
release: | |
types: [released] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: Tag/version to publish | |
required: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# 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 | |
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 | |
with: | |
working-directory: clients/python | |
ruby-version: '2.7' | |
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/[email protected] | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_TOKEN }} | |
with: | |
source_file: clients/python/_site/. | |
destination_repo: treeverse/docs-lakefs-sdk-python | |
destination_folder: / | |
user_email: '[email protected]' | |
user_name: 'python-docs-action' | |
deploy-legacy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# 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 legacy package | |
run: make package-python-client PACKAGE_VERSION=${{ steps.version.outputs.tag }} | |
- name: Python legacy SDK legacy publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: clients/python-legacy/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 | |
with: | |
working-directory: clients/python-legacy | |
ruby-version: '2.7' | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Build legacy release as latest | |
working-directory: clients/python-legacy | |
run: bundle exec jekyll build -d _site -b / | |
- name: Build legacy release ${{ steps.docver.outputs.tag }} | |
working-directory: clients/python-legacy | |
run: bundle exec jekyll build -d _site/${{ steps.docver.outputs.tag }} -b /${{ steps.docver.outputs.tag }} | |
- name: Publish legacy to docs repository | |
uses: dmnemec/[email protected] | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_TOKEN }} | |
with: | |
source_file: clients/python-legacy/_site/. | |
destination_repo: treeverse/docs-lakefs-python | |
destination_folder: / | |
user_email: '[email protected]' | |
user_name: 'python-docs-action' |