Debian Codegraph @

.github/workflows/release.yml

raw symbols SCIP
1 name: Build package
2
3 on:
4 push:
5 pull_request:
6 release:
7 types:
8 - published
9 workflow_dispatch:
10
11 permissions: {}
12
13 env:
14 FORCE_COLOR: 1
15
16 jobs:
17 # Always build & lint package.
18 build-package:
19 name: Build & verify package
20 runs-on: ubuntu-latest
21
22 steps:
23 - uses: actions/checkout@v5
24 with:
25 fetch-depth: 0
26 persist-credentials: false
27
28 - uses: hynek/build-and-inspect-python-package@v2
29
30 # Publish to Test PyPI on every commit on main.
31 release-test-pypi:
32 name: Publish in-dev package to test.pypi.org
33 if: |
34 github.event.repository.fork == false
35 && github.event_name == 'push'
36 && github.ref == 'refs/heads/main'
37 runs-on: ubuntu-latest
38 needs: build-package
39
40 permissions:
41 id-token: write
42
43 steps:
44 - name: Download packages built by build-and-inspect-python-package
45 uses: actions/download-artifact@v6
46 with:
47 name: Packages
48 path: dist
49
50 - name: Publish to Test PyPI
51 uses: pypa/gh-action-pypi-publish@release/v1
52 with:
53 repository-url: https://test.pypi.org/legacy/
54
55 # Publish to PyPI on GitHub Releases.
56 release-pypi:
57 name: Publish to PyPI
58 # Only run for published releases.
59 if: |
60 github.event.repository.fork == false
61 && github.event.action == 'published'
62 runs-on: ubuntu-latest
63 needs: build-package
64
65 permissions:
66 id-token: write
67
68 steps:
69 - name: Download packages built by build-and-inspect-python-package
70 uses: actions/download-artifact@v6
71 with:
72 name: Packages
73 path: dist
74
75 - name: Publish to PyPI
76 uses: pypa/gh-action-pypi-publish@release/v1