Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/python-client-build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: "Build Python Client Artifacts"

on:
workflow_dispatch:
inputs:
version:
description: 'Version to set (optional, e.g. 1.1.0 or 1.1.0rc1 or dev-20251202-abc1234)'
type: string
required: false
workflow_call:
inputs:
version:
description: 'Version to set (optional)'
type: string
required: false
pull_request:
paths:
- '.github/workflows/python-client-build-artifacts.yml'
- 'client/python/**'

jobs:
build-artifacts:
name: Build artifacts on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not compatible with windows

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
- name: Set up JDK for openapi-generator-cli
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
with:
distribution: 'temurin'
java-version: '21'

- name: Set version (if provided)
if: inputs.version != ''
env:
VERSION: ${{ inputs.version }}
run: make client-set-version VERSION="${{ env.VERSION }}"

- name: Build source distribution
run: |
make client-build FORMAT=sdist

- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
package-dir: "./client/python"
config-file: "{package}/pyproject.toml"
env:
# Ignore 32 bit architectures
CIBW_ARCHS: "auto64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10,<3.14"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # Disable wheel repair since there will be no binary in the wheel
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
CIBW_ENVIRONMENT: POLARIS_CLI_SKIP_CLIENT_GENERATION="true" # java is not available in linux containers during wheel build, skip client generation

- name: Add source distribution
if: startsWith(matrix.os, 'ubuntu-24.04')
run: ls -lah ./client/python/dist/* && cp ./client/python/dist/* wheelhouse/

- uses: actions/upload-artifact@v4
with:
name: "python-client-artifacts-${{ matrix.os }}"
path: ./wheelhouse/*

merge-artifacts:
runs-on: ubuntu-latest
needs:
- build-artifacts
steps:
- name: Generate artifact name
id: artifact-name
run: |
if [ -n "${{ inputs.version }}" ]; then
ARTIFACT_NAME="python-client-artifacts-${{ inputs.version }}"
else
ARTIFACT_NAME="python-client-artifacts-${{ github.run_id }}"
fi
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
echo "Using artifact name: $ARTIFACT_NAME"

- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: ${{ steps.artifact-name.outputs.ARTIFACT_NAME }}
pattern: python-client-artifacts-*
delete-merged: true

56 changes: 56 additions & 0 deletions .github/workflows/python-client-nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: "Python Client Nightly Build"

on:
workflow_dispatch:

jobs:
generate-version:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.generate-version.outputs.VERSION }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1

- name: Generate nightly version
id: generate-version
run: |
# Generate version in format: dev-YYYYMMDD-<short-commit-hash>
DATE=$(date -u +%Y%m%d)
COMMIT_HASH=$(git rev-parse --short HEAD)
VERSION="dev-${DATE}-${COMMIT_HASH}"

echo "Generated nightly version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Display Generated Version
run: |
echo "Using Version: ${{ steps.generate-version.outputs.VERSION }}"

build-nightly-artifacts:
needs:
- generate-version
uses: ./.github/workflows/python-client-build-artifacts.yml
with:
version: ${{ needs.generate-version.outputs.VERSION }}

98 changes: 98 additions & 0 deletions .github/workflows/python-client-release-pypi-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: "Build Python Client Release PyPI Artifacts"

on:
workflow_call:
inputs:
VERSION:
required: true
type: string

jobs:
pypi-build-artifacts:
name: Build artifacts for SVN on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not compatible with windows

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
- name: Set up JDK for openapi-generator-cli
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
with:
distribution: 'temurin'
java-version: '21'

- name: Set version with RC
env:
VERSION: ${{ inputs.VERSION }}
run: make client-set-version VERSION="${{ env.VERSION }}"

- name: Build source distribution
run: |
make client-build FORMAT=sdist

- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
package-dir: "./client/python"
config-file: "{package}/pyproject.toml"
env:
# Ignore 32 bit architectures
CIBW_ARCHS: "auto64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10,<3.14"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # Disable wheel repair since there will be no binary in the wheel
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
CIBW_ENVIRONMENT: POLARIS_CLI_SKIP_CLIENT_GENERATION="true" # java is not available in linux containers during wheel build, skip client generation

- name: Add source distribution
if: startsWith(matrix.os, 'ubuntu-24.04')
run: ls -lah ./client/python/dist/* && cp ./client/python/dist/* wheelhouse/

- uses: actions/upload-artifact@v4
with:
name: "python-client-pypi-release-candidate-${{ matrix.os }}"
path: ./wheelhouse/*

pypi-merge-artifacts:
runs-on: ubuntu-latest
needs:
- pypi-build-artifacts
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: "python-client-pypi-release-candidate-${{ inputs.VERSION }}"
pattern: python-client-pypi-release-candidate*
delete-merged: true
93 changes: 93 additions & 0 deletions .github/workflows/python-client-release-svn-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: "Build Python Client Release SVN Artifacts"

on:
workflow_call:
inputs:
VERSION:
required: true
type: string

jobs:
svn-build-artifacts:
name: Build artifacts for SVN on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-24.04, macos-14, macos-15] # current build script is not compatible with windows

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: |
3.10
3.11
3.12
3.13
- name: Set up JDK for openapi-generator-cli
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
with:
distribution: 'temurin'
java-version: '21'

- name: Build source distribution
run: |
make client-build FORMAT=sdist

- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
package-dir: "./client/python"
config-file: "{package}/pyproject.toml"
env:
# Ignore 32 bit architectures
CIBW_ARCHS: "auto64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10,<3.14"
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # Disable wheel repair since there will be no binary in the wheel
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
CIBW_ENVIRONMENT: POLARIS_CLI_SKIP_CLIENT_GENERATION="true" # java is not available in linux containers during wheel build, skip client generation

- name: Add source distribution
if: startsWith(matrix.os, 'ubuntu-24.04')
run: ls -lah ./client/python/dist/* && cp ./client/python/dist/* wheelhouse/

- uses: actions/upload-artifact@v4
with:
name: "python-client-svn-release-candidate-${{ matrix.os }}"
path: ./wheelhouse/*

svn-merge-artifacts:
runs-on: ubuntu-latest
needs:
- svn-build-artifacts
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: "python-client-svn-release-candidate-${{ inputs.VERSION }}"
pattern: python-client-svn-release-candidate*
delete-merged: true
Loading