Skip to content
Open
Changes from 9 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
112 changes: 104 additions & 8 deletions .github/workflows/mobile-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ permissions:

on:
workflow_dispatch:
inputs:
job_to_run:
description: 'Select the job to run'
required: true
default: 'all'
type: choice
options:
- all
- android
- python
schedule:
# Mondays at 1pm UTC (8am EST)
- cron: "0 13 * * 1"
Expand All @@ -18,16 +28,17 @@ jobs:
contents: read
uses: ./.github/workflows/_load_env.yml

release:
android-release:
permissions:
contents: read
packages: read
if: >-
${{
github.repository == 'envoyproxy/envoy'
&& (github.event.schedule
|| !contains(github.actor, '[bot]'))
}}
github.repository == 'envoyproxy/envoy'
&& (github.event.schedule
|| !contains(github.actor, '[bot]'))
&& (github.event.inputs.job_to_run == 'all'
|| github.event.inputs.job_to_run == 'android'
|| github.event_name == 'schedule')
needs: env
uses: ./.github/workflows/_mobile_container_ci.yml
with:
Expand Down Expand Up @@ -76,8 +87,14 @@ jobs:
//:android_dist
output: envoy

deploy:
needs: release
android-deploy:
needs: android-release
if: >-
always()
&& (github.event.inputs.job_to_run == 'all'
|| github.event.inputs.job_to_run == 'android'
|| github.event_name == 'schedule')
&& (needs.android-release.result == 'success')
permissions:
contents: read
packages: read
Expand Down Expand Up @@ -141,3 +158,82 @@ jobs:
${{ matrix.output }}-pom.xml.asc \
${{ matrix.output }}-sources.jar.asc \
${{ matrix.output }}-javadoc.jar.asc

python-release:
permissions:
actions: read
contents: read
packages: read
if: >-
github.repository == 'envoyproxy/envoy'
&& (github.event_name == 'workflow_dispatch')
&& (github.event.inputs.job_to_run == 'all'
|| github.event.inputs.job_to_run == 'python')
needs: env
name: Build and Publish Python Wheel
uses: ./.github/workflows/_mobile_container_ci.yml
with:
args: ${{ matrix.args }}
container: ${{ fromJSON(needs.env.outputs.build-image).mobile }}
container-output: |
"bazel-bin/library/python/": build/
request: ${{ needs.env.outputs.request }}
steps-post: |
- name: Repair wheel
run: |
mkdir -p /tmp/dist
WHEEL_PATH=$(find /tmp/container-output/build -name "*.whl" | head -n 1)

if [[ -z "$WHEEL_PATH" ]]; then
echo "Error: No wheel file found in /tmp/container-output/build"
ls -R /tmp/container-output/
exit 1
fi
python3 -m venv envoy_wheel
source envoy_wheel/bin/activate
pip install patchelf auditwheel

auditwheel repair "$WHEEL_PATH" --wheel-dir /tmp/dist
shell: bash
target: ${{ matrix.target }}
upload-name: python-wheel
upload-path: /tmp/dist/*.whl
strategy:
fail-fast: false
matrix:
include:
- target: envoy_mobile_wheel
args: >-
build
--config=ci
--config=mobile-rbe
--config=mobile-release
-c opt --strip=always
//library/python:envoy_mobile_wheel
--//library/python:python_platform="manylinux2014_x86_64"

python-publish:
needs: python-release
if: >-
always()
&& (github.event.inputs.job_to_run == 'all'
|| github.event.inputs.job_to_run == 'python')
&& (needs.python-release.result == 'success')
permissions:
contents: read
id-token: write
packages: read
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
environment:
name: pypi
url: https://pypi.org/p/envoy-mobile
steps:
- uses: actions/download-artifact@v4
with:
name: python-wheel
path: dist/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1