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 - 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