File: python_publish.yml

package info (click to toggle)
knockpy 9.0.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 560 kB
  • sloc: python: 6,435; makefile: 3
file content (33 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Publish to PyPI

on:
  release:
    types: [published]

permissions:
  contents: read

jobs:
  build-and-publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
          cache: pip

      - name: Build dists
        run: |
          python -m pip install --upgrade pip
          pip install build twine
          python -m build
          twine check dist/*

      - name: Publish to PyPI
        # Uses an API token stored as a GitHub Actions secret: PYPI_TOKEN
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.PYPI_TOKEN }}