-
Notifications
You must be signed in to change notification settings - Fork 5
111 lines (93 loc) · 3.42 KB
/
release.yml
File metadata and controls
111 lines (93 loc) · 3.42 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
generate-changelog:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
changelog: ${{ steps.changelog.outputs.changelog }}
release_body: ${{ steps.release_notes.outputs.body }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
run: |
set -e
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s" ${{ github.ref_name }})
else
CHANGELOG=$(git log --pretty=format:"- %s" $PREV_TAG..${{ github.ref_name }})
fi
CHANGELOG=$(echo "$CHANGELOG" | grep -vE "^(chore|ci|docs):" || echo "- Initial release")
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate release notes
id: release_notes
run: |
cat > release_body.md << 'EOF'
# 🎉 Clipse GUI v${{ steps.get_version.outputs.version }}
A GTK3 graphical user interface for the excellent
[clipse](https://github.com/savedra1/clipse).
## 📦 Install
- **Arch Linux**: `yay -S clipse-gui` (AUR)
- **Other distros**: download the wheel below and run
`pip install clipse_gui-*.whl`. Requires system `python-gobject`,
`gtk3`, `wl-clipboard`, and `xdotool` or `wtype`.
- **From source**: download the `.tar.gz` sdist and run `pip install`,
or clone and use `python -m build` + `python -m installer`.
> ⚠️ The Nuitka onefile and AppImage are no longer published — they
> shipped a frozen `gi` that asserted against the user's live `glib2`
> and crashed on rolling distros (issues #13, #14). The wheel + sdist
> install path keeps `gi` in lockstep with the user's system Python.
## 📝 Changelog
${{ steps.changelog.outputs.changelog }}
EOF
echo "body<<EOF" >> $GITHUB_OUTPUT
cat release_body.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
build-distributions:
runs-on: ubuntu-latest
needs: generate-changelog
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build tooling
run: python -m pip install --upgrade pip build
- name: Build wheel + sdist
run: python -m build
- uses: actions/upload-artifact@v4
with:
name: distributions
path: dist/
create-release:
runs-on: ubuntu-latest
needs:
- generate-changelog
- build-distributions
steps:
- uses: actions/download-artifact@v4
with:
name: distributions
path: dist
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "Release v${{ needs.generate-changelog.outputs.version }}"
body: ${{ needs.generate-changelog.outputs.release_body }}
files: |
dist/*.whl
dist/*.tar.gz