| 1 | name: upload-wheel |
| 2 | |
| 3 | description: "Upload wheels to Pypi" |
| 4 | inputs: |
| 5 | pypi_token: |
| 6 | required: true |
| 7 | description: "release token for the repo" |
| 8 | fury_token: |
| 9 | required: true |
| 10 | description: "release token for the fury repo" |
| 11 | |
| 12 | runs: |
| 13 | using: "composite" |
| 14 | steps: |
| 15 | - name: Install dependencies |
| 16 | shell: bash |
| 17 | run: | |
| 18 | python -m pip install --upgrade pip |
| 19 | pip install twine |
| 20 | - name: Choose repo |
| 21 | shell: bash |
| 22 | id: choose_repo |
| 23 | run: | |
| 24 | if [ ${{ github.ref }} == "*beta*" ]; then |
| 25 | echo "repo=fury" >> $GITHUB_OUTPUT |
| 26 | else |
| 27 | echo "repo=pypi" >> $GITHUB_OUTPUT |
| 28 | fi |
| 29 | - name: Publish to PyPI |
| 30 | shell: bash |
| 31 | env: |
| 32 | FURY_TOKEN: ${{ inputs.fury_token }} |
| 33 | PYPI_TOKEN: ${{ inputs.pypi_token }} |
| 34 | run: | |
| 35 | if [ ${{ steps.choose_repo.outputs.repo }} == "fury" ]; then |
| 36 | WHEEL=$(ls target/wheels/lancedb-*.whl 2> /dev/null | head -n 1) |
| 37 | echo "Uploading $WHEEL to Fury" |
| 38 | curl -f -F package=@$WHEEL https://$FURY_TOKEN@push.fury.io/lancedb/ |
| 39 | else |
| 40 | twine upload --repository ${{ steps.choose_repo.outputs.repo }} \ |
| 41 | --username __token__ \ |
| 42 | --password $PYPI_TOKEN \ |
| 43 | target/wheels/lancedb-*.whl |
| 44 | fi |