Skip to content

Commit 4d9f21e

Browse files
author
Luca Pisani
committed
Implement automatic versioning and RPM release
- Add GitHub Actions workflows for release and RPM build - Add RPM spec file for Fedora packaging - Configure semantic versioning with patch bumps on main merges
1 parent 49a131d commit 4d9f21e

3 files changed

Lines changed: 90 additions & 0 deletions

File tree

.github/workflows/build-rpm.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build RPM
2+
3+
on:
4+
push:
5+
tags: [ 'v*' ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install dependencies
13+
run: |
14+
sudo apt update
15+
sudo apt install -y rpm
16+
- name: Get version
17+
run: |
18+
VERSION=${GITHUB_REF#refs/tags/v}
19+
echo "VERSION=$VERSION" >> $GITHUB_ENV
20+
- name: Create source tarball
21+
run: |
22+
tar -czf notes-${VERSION}.tar.gz --exclude=.git --exclude=.github .
23+
- name: Build RPM
24+
run: |
25+
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
26+
mv notes-${VERSION}.tar.gz ~/rpmbuild/SOURCES/
27+
rpmbuild -ba packaging/notes.spec --define "version $VERSION"
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: notes-${{ env.VERSION }}-1.noarch.rpm
31+
path: ~/rpmbuild/RPMS/noarch/notes-${{ env.VERSION }}-1.noarch.rpm

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- uses: cycjimmy/semantic-release-action@v3
15+
with:
16+
semantic_version: 18.0.0
17+
extra_plugins: |
18+
@semantic-release/changelog
19+
@semantic-release/git
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

packaging/notes.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Name: notes
2+
Version: %{version}
3+
Release: 1%{?dist}
4+
Summary: Note taking application
5+
6+
License: MIT
7+
URL: https://github.com/%{owner}/%{name}
8+
Source0: %{name}-%{version}.tar.gz
9+
10+
BuildArch: noarch
11+
BuildRequires: python3
12+
13+
%description
14+
A native desktop application for KDE written in Python, similar to Joplin, with WYSIWYG editing, speech-to-text, and trash management.
15+
16+
%prep
17+
%setup -q
18+
19+
%build
20+
21+
%install
22+
mkdir -p %{buildroot}%{_datadir}/%{name}
23+
cp -r . %{buildroot}%{_datadir}/%{name}
24+
mkdir -p %{buildroot}%{_bindir}
25+
cat > %{buildroot}%{_bindir}/%{name} << 'EOF'
26+
#!/bin/bash
27+
cd %{_datadir}/%{name}
28+
python3 main.py "$@"
29+
EOF
30+
chmod +x %{buildroot}%{_bindir}/%{name}
31+
32+
%files
33+
%{_datadir}/%{name}
34+
%{_bindir}/%{name}
35+
36+
%changelog
37+
* Sun Dec 08 2025 Your Name <your@email.com> - %{version}-1
38+
- Initial package

0 commit comments

Comments
 (0)