mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-26 22:59:57 +00:00
We have been publishing all releases--even preview ones--to PyPI. This was because of a faulty bash if statement. This PR fixes that conditional.
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: upload-wheel
|
|
|
|
description: "Upload wheels to Pypi"
|
|
inputs:
|
|
pypi_token:
|
|
required: true
|
|
description: "release token for the repo"
|
|
fury_token:
|
|
required: true
|
|
description: "release token for the fury repo"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install twine
|
|
python3 -m pip install --upgrade pkginfo
|
|
- name: Choose repo
|
|
shell: bash
|
|
id: choose_repo
|
|
run: |
|
|
if [[ ${{ github.ref }} == *beta* ]]; then
|
|
echo "repo=fury" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "repo=pypi" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Publish to PyPI
|
|
shell: bash
|
|
env:
|
|
FURY_TOKEN: ${{ inputs.fury_token }}
|
|
PYPI_TOKEN: ${{ inputs.pypi_token }}
|
|
run: |
|
|
if [[ ${{ steps.choose_repo.outputs.repo }} == fury ]]; then
|
|
WHEEL=$(ls target/wheels/lancedb-*.whl 2> /dev/null | head -n 1)
|
|
echo "Uploading $WHEEL to Fury"
|
|
curl -f -F package=@$WHEEL https://$FURY_TOKEN@push.fury.io/lancedb/
|
|
else
|
|
twine upload --repository ${{ steps.choose_repo.outputs.repo }} \
|
|
--username __token__ \
|
|
--password $PYPI_TOKEN \
|
|
target/wheels/lancedb-*.whl
|
|
fi
|