File: release.yml

package info (click to toggle)
python-ecs-logging 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 344 kB
  • sloc: python: 1,116; sh: 30; makefile: 7
file content (57 lines) | stat: -rw-r--r-- 1,269 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]+"
    branches:
      - main

permissions:
  contents: read

jobs:
  packages:
    permissions:
      attestations: write
      id-token: write
      contents: read
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - run: pip install build==1.2.1

      - run: python -m build

      - name: generate build provenance
        uses: actions/attest-build-provenance@v3
        with:
          subject-path: "${{ github.workspace }}/dist/*"

      - name: Upload Packages
        uses: actions/upload-artifact@v6
        with:
          name: packages
          path: |
            dist/*.whl
            dist/*tar.gz

  publish-pypi:
    needs:
      - packages
    runs-on: ubuntu-latest
    environment: release
    permissions:
      id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
    steps:
      - uses: actions/download-artifact@v7
        with:
          name: packages
          path: dist

      - name: Upload pypi.org
        if: startsWith(github.ref, 'refs/tags')
        uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
        with:
          repository-url: https://upload.pypi.org/legacy/