Publish to PyPI #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Workflow: Publish to PyPI | |
# This workflow automates the process of testing and publishing Py-Marqo to PyPI. | |
# This workflow: | |
# 1. Runs unit tests using the test.yml workflow | |
# 2. Publishes the package to PyPI given the unit tests passed | |
name: Publish to PyPI | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
Run-tests: | |
name: Run tests | |
uses: ./.github/workflows/test.yml | |
secrets: inherit | |
Publish-to-PyPi: | |
runs-on: ubuntu-latest | |
environment: PyPI | |
needs: | |
- Run-tests | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Hatch | |
run: pip install hatch | |
- name: Build package | |
run: hatch build | |
- name: Publish marqo-haystack | |
env: | |
HATCH_INDEX_USER: __token__ | |
HATCH_INDEX_AUTH: ${{ secrets.PYPI_MARQO_HAYSTACK_TOKEN }} | |
run: hatch publish -y |