diff --git a/.github/workflows/release_oonidata.yml b/.github/workflows/release_oonidata.yml new file mode 100644 index 00000000..a1204a7b --- /dev/null +++ b/.github/workflows/release_oonidata.yml @@ -0,0 +1,32 @@ +name: Publish oonidata to PyPI + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.x' # Specify the Python version + + - name: Install Hatch + run: | + python -m pip install --upgrade pip + pip install hatch + + - name: Publish oonidata + run: | + cd oonidata + hatch publish + env: + HATCH_INDEX_USER: __token__ + HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} + if: secrets.PYPI_TOKEN != '' # Only run if PYPI_TOKEN is set