-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.93 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (51 loc) · 1.93 KB
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
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write # needed to create releases
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for changelog generation
# -----------------------------------------------------------------------
# Build a Python source distribution + wheel for the release assets
# -----------------------------------------------------------------------
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install build tools
run: pip install build
- name: Build distribution packages
run: python -m build
# -----------------------------------------------------------------------
# Auto-generate changelog from commit messages since last tag
# -----------------------------------------------------------------------
- name: Generate changelog
id: changelog
uses: orhun/git-cliff-action@v3
with:
config: .github/cliff.toml
args: --latest --strip header
continue-on-error: true # fall back to empty notes if cliff not configured
# -----------------------------------------------------------------------
# Create the GitHub Release
# -----------------------------------------------------------------------
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: "Guardian CLI ${{ github.ref_name }}"
body: ${{ steps.changelog.outputs.content || 'See commit history for changes.' }}
draft: false
prerelease: ${{ contains(github.ref_name, '-') }} # v1.0.0-beta → prerelease
files: |
dist/*.whl
dist/*.tar.gz
generate_release_notes: true