File: release.yml

package info (click to toggle)
isort 8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,404 kB
  • sloc: python: 14,876; javascript: 42; makefile: 28; sh: 21
file content (57 lines) | stat: -rw-r--r-- 1,407 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
name: Release

"on":
  push:
    tags:
      - "[0-9]+.[0-9]+.[0-9]+"

jobs:
  release:
    if: github.repository_owner == 'PyCQA'
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 2

      - name: Set Tag env
        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.13"

      - name: Install UV
        uses: astral-sh/setup-uv@v7
        with:
          version-file: "pyproject.toml"

      - name: Install dependencies
        run: |
          uv sync --all-extras --frozen

      - name: Check if there is a parent commit
        id: check-parent-commit
        run: |
          echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"

      - name: Build package
        run: |
          uv build

      - name: Publish package on PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.PYPI_API_TOKEN }}

      - name: Publish the release notes
        uses: release-drafter/release-drafter@v6
        with:
          publish: ${{ steps.check-version.outputs.tag != '' }}
          tag: ${{ steps.check-version.outputs.tag }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}