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
28 changes: 28 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ on:
required: false
default: true
type: boolean
custom_pypi_url:
description: "Custom PyPI index URL (e.g., Azure Artifacts). If set, uploads to this instead of default PyPI/Fury"
required: false
default: ""
type: string
custom_pypi_token:
description: "Access token for the custom PyPI index"
required: false
default: ""
type: string
pull_request:
branches:
- main
Expand Down Expand Up @@ -93,6 +103,12 @@ jobs:
pypi_token: ${{ secrets.PYPI_TOKEN }}
fury_token: ${{ secrets.FURY_TOKEN }}
repo: ${{ steps.handle_tag.outputs.repo }}
- uses: ./.github/workflows/upload_wheel
if: github.event_name == 'workflow_dispatch' && inputs.custom_pypi_url != ''
with:
repo: custom
custom_pypi_url: ${{ inputs.custom_pypi_url }}
custom_pypi_token: ${{ inputs.custom_pypi_token }}
mac:
timeout-minutes: 60
runs-on: ${{ matrix.config.runner }}
Expand Down Expand Up @@ -144,6 +160,12 @@ jobs:
pypi_token: ${{ secrets.PYPI_TOKEN }}
fury_token: ${{ secrets.FURY_TOKEN }}
repo: ${{ steps.handle_tag.outputs.repo }}
- uses: ./.github/workflows/upload_wheel
if: github.event_name == 'workflow_dispatch' && inputs.custom_pypi_url != ''
with:
repo: custom
custom_pypi_url: ${{ inputs.custom_pypi_url }}
custom_pypi_token: ${{ inputs.custom_pypi_token }}
windows:
timeout-minutes: 60
runs-on: windows-latest-4x
Expand Down Expand Up @@ -191,6 +213,12 @@ jobs:
pypi_token: ${{ secrets.PYPI_TOKEN }}
fury_token: ${{ secrets.FURY_TOKEN }}
repo: ${{ steps.handle_tag.outputs.repo }}
- uses: ./.github/workflows/upload_wheel
if: github.event_name == 'workflow_dispatch' && inputs.custom_pypi_url != ''
with:
repo: custom
custom_pypi_url: ${{ inputs.custom_pypi_url }}
custom_pypi_token: ${{ inputs.custom_pypi_token }}
report-failure:
name: Report Workflow Failure
runs-on: ubuntu-latest
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/upload_wheel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ inputs:
- "pypi"
- "testpypi"
- "fury"
- "custom"
default: "pypi"
pypi_token:
required: true
required: false
description: "release token for the repo"
fury_token:
required: true
required: false
description: "release token for the fury repo"
custom_pypi_url:
required: false
description: "Custom PyPI index URL (e.g., Azure Artifacts)"
custom_pypi_token:
required: false
description: "Access token for the custom PyPI index"

runs:
using: "composite"
Expand All @@ -35,11 +42,19 @@ runs:
env:
FURY_TOKEN: ${{ inputs.fury_token }}
PYPI_TOKEN: ${{ inputs.pypi_token }}
CUSTOM_PYPI_URL: ${{ inputs.custom_pypi_url }}
CUSTOM_PYPI_TOKEN: ${{ inputs.custom_pypi_token }}
run: |
if [ ${{ inputs.repo }} == "fury" ]; then
if [ "${{ inputs.repo }}" == "fury" ]; then
WHEEL=$(ls target/wheels/pylance-*.whl 2> /dev/null | head -n 1)
echo "Uploading $WHEEL to Fury"
curl -f -F package=@$WHEEL https://$FURY_TOKEN@push.fury.io/lance-format/
elif [ "${{ inputs.repo }}" == "custom" ]; then
echo "Uploading to custom PyPI index: $CUSTOM_PYPI_URL"
twine upload --repository-url "$CUSTOM_PYPI_URL" \
--username __token__ \
--password "$CUSTOM_PYPI_TOKEN" \
target/wheels/pylance-*.whl
else
twine upload --repository ${{ inputs.repo }} \
--username __token__ \
Expand Down
Loading