{#- OZI 0.2
# ozi/templates/github_workflows/publish.yml
# SPDX-License-Identifier: Unlicense
#}
  publish:
    runs-on: ubuntu-latest
    needs: [draft, release, generate-provenance]
    if: needs.draft.outputs.drafted == 'true'
    permissions:
      contents: write
      id-token: write
    steps:
{%- if project.github_harden_runner %}
{% include "github_workflows/harden_runner.yml.j2" %}
        allowed-endpoints: >
        {%- for endpoint in spec.python.ci.github.harden_runner.endpoints.publish.split(' ') %}
            {{ endpoint }}
        {%- endfor %}
{%- endif %}

    - uses: OZI-Project/publish@{{ spec.python.ci.publish.version }}
      with:
{%- raw %}
        github-token: ${{ secrets.GITHUB_TOKEN }}
{%- endraw %}

    - name: Publish package distributions to PyPI
      uses: pypa/gh-action-pypi-publish@{{ spec.python.ci.github.gh_action_pypi_publish.version }}