Debian Codegraph @

.github/workflows/publish.yml

raw symbols SCIP
1 name: Build and Publish Package
2
3 on:
4 pull_request:
5 branches:
6 - main
7 types:
8 - closed
9
10 jobs:
11 publish-package:
12 if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v') }}
13 runs-on: ubuntu-latest
14 environment: publish
15 permissions:
16 id-token: write
17 contents: write
18
19 steps:
20 - name: Check out repo main branch
21 uses: actions/checkout@v5
22 with:
23 ref: main
24
25 - name: Set up Python 3.10
26 uses: actions/setup-python@v6
27 with:
28 python-version-file: ".python-version"
29
30 - name: Install uv
31 uses: astral-sh/setup-uv@v6
32 with:
33 version: "0.9.3"
34
35 - name: Get project Version
36 id: project_version
37 run: echo "project_version=$(uv version --short)" >> $GITHUB_OUTPUT
38
39 - name: Build package
40 run: uv build --all-packages
41
42 - name: Publish package to PyPI
43 uses: pypa/gh-action-pypi-publish@release/v1
44
45 - name: Create a Github Release
46 uses: softprops/action-gh-release@v3
47 with:
48 tag_name: v${{ steps.project_version.outputs.project_version }}
49 target_commitish: main
50 body_path: CHANGELOG.md
51 files: |
52 LICENSE
53 dist/**.whl
54 dist/**.tar.gz