Skip to content

Commit 99d23c8

Browse files
committed
feat(packaging): use GoReleaser instead of Docker to build RPM/Debian packages
1 parent 9e4248c commit 99d23c8

File tree

5 files changed

+141
-4
lines changed

5 files changed

+141
-4
lines changed

.github/workflows/packages.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: RPM and Debian Packages
2+
permissions: read-all
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ main ]
7+
paths:
8+
- 'packaging/**' # Only run on changes to the packaging files
9+
jobs:
10+
build-packages:
11+
name: Build Packages
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Golang
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: stable
21+
- name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v6
23+
with:
24+
version: '~> v2'
25+
args: release -f packaging/goreleaser.yaml --clean ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Upload Artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: packages
32+
path: |
33+
dist/*.deb
34+
dist/*.rpm
35+
if-no-files-found: error
36+
retention-days: 1
37+
compression-level: 0
38+
test-debian-package:
39+
name: Test Debian Package
40+
runs-on: ubuntu-latest
41+
needs: build-packages
42+
steps:
43+
- name: Download Artifacts
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: packages
47+
path: dist/
48+
- name: Install Debian Package
49+
run: |
50+
sudo apt-get update
51+
sudo dpkg -i dist/miniflux*amd64.deb
52+
- name: Test Installation
53+
run: |
54+
which miniflux
55+
miniflux -i
56+
- name: Test Systemd Service
57+
run: |
58+
# Verify service file exists and is properly installed
59+
systemctl cat miniflux
60+
61+
# Check if service is enabled by default
62+
sudo systemctl is-enabled miniflux || echo "Service not enabled by default"
63+
64+
# Check service status (should be inactive/dead but loadable)
65+
sudo systemctl status miniflux --no-pager || true
66+
67+
# Verify service can be started (will fail due to missing config, but should load)
68+
sudo systemctl start miniflux || echo "Service failed to start (expected without proper config)"
69+
70+
# Check if service is properly defined
71+
systemctl show miniflux --property=Type,ExecStart,User,Group --no-pager

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
./*.sha256
2-
/miniflux
32
.idea
43
.vscode
54
*.deb
65
*.rpm
7-
miniflux-*
6+
/miniflux
7+
dist
8+
miniflux-*

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ run:
8585
@ LOG_DATE_TIME=1 LOG_LEVEL=debug RUN_MIGRATIONS=1 CREATE_ADMIN=1 ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go
8686

8787
clean:
88-
@ rm -f $(APP)-* $(APP) $(APP)*.rpm $(APP)*.deb $(APP)*.exe $(APP)*.sha256
88+
@ rm -rf $(APP)-* $(APP) $(APP)*.rpm $(APP)*.deb $(APP)*.exe $(APP)*.sha256 dist
8989

9090
add-string:
9191
cd internal/locale/translations && \

packaging/goreleaser.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: 2
2+
3+
builds:
4+
- id: miniflux
5+
binary: miniflux
6+
env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
# We will enable cross-compilation for other OSes later
11+
# - darwin
12+
# - freebsd
13+
# - openbsd
14+
goarch:
15+
- amd64
16+
- arm64
17+
- arm
18+
goarm:
19+
- 6
20+
- 7
21+
ignore:
22+
- goos: darwin
23+
goarch: arm
24+
- goos: darwin
25+
goarch: amd64
26+
- goos: freebsd
27+
goarch: arm64
28+
- goos: freebsd
29+
goarch: arm
30+
- goos: openbsd
31+
goarch: arm64
32+
- goos: openbsd
33+
goarch: arm
34+
ldflags:
35+
- "-s -w -X miniflux.app/v2/internal/version.Version={{.Version}}"
36+
37+
nfpms:
38+
- id: miniflux-packages
39+
package_name: miniflux
40+
vendor: Miniflux
41+
maintainer: "Frédéric Guillot <[email protected]>"
42+
description: "Minimalist and opinionated feed reader"
43+
homepage: "https://miniflux.app/"
44+
license: Apache 2.0
45+
file_name_template: "{{ .PackageName }}_{{ .Version }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}"
46+
formats:
47+
- deb
48+
- rpm
49+
contents:
50+
- src: "./packaging/miniflux.conf"
51+
dst: "/etc/miniflux.conf"
52+
file_info:
53+
mode: 0644
54+
- src: "./packaging/systemd/miniflux.service"
55+
dst: "/etc/systemd/system/miniflux.service"
56+
file_info:
57+
mode: 0644
58+
- src: "./miniflux.1"
59+
dst: "/usr/share/man/man1/miniflux.1"
60+
file_info:
61+
mode: 0644
62+
deb:
63+
lintian_overrides:
64+
- statically-linked-binary
65+
- changelog-file-missing-in-native-package

packaging/systemd/miniflux.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ After=network.target postgresql.service
1313

1414
[Service]
1515
ExecStart=/usr/bin/miniflux
16-
User=miniflux
16+
DynamicUser=yes
1717

1818
# Load environment variables from /etc/miniflux.conf.
1919
EnvironmentFile=/etc/miniflux.conf

0 commit comments

Comments
 (0)