File: publish.yml

package info (click to toggle)
python-multipart 0.0.20-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 812 kB
  • sloc: python: 2,226; sh: 17; makefile: 5
file content (59 lines) | stat: -rw-r--r-- 1,271 bytes parent folder | download | duplicates (2)
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
58
59
name: Publish Python Package

on:
  push:
    tags:
      - "**"

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      version: ${{ steps.inspect_package.outputs.version }}
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v4
        with:
          version: "0.4.12"
          enable-cache: true

      - name: Set up Python
        run: uv python install 3.12

      - name: Build package
        run: uv build

      - name: Inspect package version
        id: inspect_package
        run: |
          version=$(uvx hatchling version)
          echo "version=$version" >> "$GITHUB_OUTPUT"

      - name: Upload package
        uses: actions/upload-artifact@v4
        with:
          name: package-distributions
          path: dist/

  pypi-publish:
    runs-on: ubuntu-latest
    needs: build

    permissions:
      id-token: write

    environment:
      name: pypi
      url: https://pypi.org/project/python-multipart/${{ needs.build.outputs.version }}

    steps:
    - name: Download package
      uses: actions/download-artifact@v4
      with:
        name: package-distributions
        path: dist/

    - name: Publish distribution 📦 to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1