-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (50 loc) · 1.56 KB
/
package-build-publish-release.yml
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
60
61
62
# .github/workflows/publish.yml
name: "Build package, publish to PyPI, create GitHub release"
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
packages: read
jobs:
package_build_publish_release:
environment: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release notes
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: pyproject.toml
args: --verbose
env:
OUTPUT: RELEASE_NOTES.md
GITHUB_REPO: ${{ github.repository }}
- name: Print the release notes
run: cat "${{ steps.git-cliff.outputs.changelog }}"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.9"
cache-dependency-glob: uv.lock
enable-cache: true
- name: Build package into dist/
run: uv build
- name: Publish package to PyPI
run: uv publish -t ${{ secrets.UV_PUBLISH_TOKEN }}
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} ./dist/* --notes-file ${{ steps.git-cliff.outputs.changelog }}
- name: Allow other workflows to trigger on release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/helmut-hoffer-von-ankershoffen/starbridge/dispatches \
-f event_type=release_created_programatically