70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Reusable Pip Index
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
CONCURRENCY:
|
|
required: true
|
|
type: string
|
|
COMMIT:
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
CHECK:
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
|
|
concurrency:
|
|
group: ${{ inputs.CONCURRENCY }}-pip-index
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash --noprofile --norc -euo pipefail {0}
|
|
|
|
permissions:
|
|
contents: "read"
|
|
id-token: "write"
|
|
|
|
jobs:
|
|
pr-summary:
|
|
name: Create a Pip Index file
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.11
|
|
|
|
- id: "auth"
|
|
uses: google-github-actions/auth@v2
|
|
with:
|
|
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
|
|
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
|
|
|
|
- name: "Set up Cloud SDK"
|
|
uses: "google-github-actions/setup-gcloud@v2"
|
|
with:
|
|
version: ">= 363.0.0"
|
|
|
|
- name: Install deps
|
|
# TOOD(googleapis/python-api-core#848): unpin google-api-core when this is issue is fixed.
|
|
run: pip3 install google-cloud-storage==3.4.1 Jinja2==3.1.6 google-api-core==2.27.0
|
|
|
|
- name: Render pip index and upload to gcloud
|
|
run: |
|
|
full_commit="${{ inputs.COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha) }}"
|
|
commit=$(echo $full_commit | cut -c1-7)
|
|
|
|
python scripts/ci/generate_prerelease_pip_index.py \
|
|
--title "Commit: $commit" \
|
|
--dir "commit/$commit/wheels" \
|
|
--upload \
|
|
${{ inputs.CHECK == 'true' && '--check' || '' }}
|