Skip to content

Commit 9c93943

Browse files
committed
CD: add CD job
1 parent 241f566 commit 9c93943

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/cd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CD
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
jobs:
14+
dist:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: hynek/build-and-inspect-python-package@v2
22+
23+
publish:
24+
needs: [dist]
25+
environment: pypi
26+
permissions:
27+
id-token: write
28+
attestations: write
29+
contents: read
30+
runs-on: ubuntu-latest
31+
if: github.event_name == 'release' && github.event.action == 'published'
32+
33+
steps:
34+
- uses: actions/download-artifact@v4
35+
with:
36+
name: Packages
37+
path: dist
38+
39+
- name: Generate artifact attestation for sdist and wheel
40+
uses: actions/[email protected]
41+
with:
42+
subject-path: "dist/*"
43+
44+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)