Skip to content
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/pypi-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,55 @@ jobs:
publish: "true"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install protoc 3.20.0
run: |
PB_REL="https://github.com/protocolbuffers/protobuf/releases"

OS=$(uname -s)
ARCH=$(uname -m)

# Determine OS prefix
if [[ "$OS" == "Linux" ]]; then
OS_PREFIX="linux"
elif [[ "$OS" == "Darwin" ]]; then
OS_PREFIX="osx"
else
echo "Unsupported OS: $OS"
exit 1
fi

# Determine architecture
if [[ "$ARCH" == "x86_64" ]]; then
PROTOC_ARCH="x86_64"
elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
PROTOC_ARCH="aarch_64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi

# Use 3.20.0 (has all platform binaries including osx-aarch_64)
PROTOC_ZIP="protoc-3.20.0-${OS_PREFIX}-${PROTOC_ARCH}.zip"
echo "Downloading: $PROTOC_ZIP"

curl -LO "$PB_REL/download/v3.20.0/$PROTOC_ZIP"

# Install to a custom directory, not /usr/local
sudo mkdir -p /opt/protoc
sudo unzip -o "$PROTOC_ZIP" -d /opt/protoc

# Add only the protoc bin directory to PATH
echo "/opt/protoc/bin" >> $GITHUB_PATH

/opt/protoc/bin/protoc --version

- name: Generate protobuf files
working-directory: ./python
run: |
# Verify correct protoc is used
which protoc
protoc --version

python3 dev.py protobuf

- name: Include protobuf files in the package
Expand Down
2 changes: 1 addition & 1 deletion python/glide-async/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies = [
# Note: If you add a dependency here, make sure to also add it to glide-async/requirements.txt
# Once issue https://github.com/aboutcode-org/python-inspector/issues/197 is resolved, the requirements.txt file can be removed.
"anyio>=4.9.0",
"protobuf>=6.20",
"protobuf>=3.20",
"sniffio",
"typing-extensions>=4.8.0; python_version < '3.11'",
]
Expand Down
2 changes: 1 addition & 1 deletion python/glide-shared/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Shared code for GLIDE Python clients"
dependencies = [
# ⚠️ Note: If you add a dependency here, make sure to also add it to the requirements.txt files under glide-async and glide-sync.
# Once issue https://github.com/aboutcode-org/python-inspector/issues/197 is resolved, the requirements.txt file can be removed.
"protobuf>=6.20",
"protobuf>=3.20",
"typing-extensions>=4.8.0; python_version < '3.11'",
]

Expand Down
Loading