Liu Song’s Projects


~/Projects/miniflux

git clone https://code.lsong.org/miniflux

Commit

Commit
859b4466abbb7d9ac8603b9d26a0b6d1ade54dae
Author
Frédéric Guillot <[email protected]>
Date
2023-08-08 21:54:09 -0700 -0700
Diffstat
 .github/dependabot.yml | 19 ++++++++++++++++
 .github/workflows/ci.yml | 4 +-
 .github/workflows/linters.yml | 2 
 .github/workflows/packages.yml | 42 ++++++++++++++++++++++++++++++++++++
 go.mod | 3 +
 go.sum | 5 ++++
 packaging/debian/Dockerfile | 7 +++--
 packaging/debian/compat | 2 
 packaging/debian/control | 1 
 packaging/debian/copyright | 2 
 packaging/rpm/miniflux.spec | 5 ++++

Upgrade to Go 1.21


diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index dad80f0bbb16710d888da37653621e9915c344cc..364e597412ce9a05ef4165c8fb4b6c8476a23c7f 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -28,6 +28,25 @@     assignees:
       - "fguillot"
 
 version: 2
+version: 2
+    directory: "packaging/debian"
+    schedule:
+      interval: "weekly"
+    reviewers:
+      - "fguillot"
+    assignees:
+      - "fguillot"
+
+  - package-ecosystem: "docker"
+    directory: "packaging/rpm"
+    schedule:
+      interval: "weekly"
+    reviewers:
+      - "fguillot"
+    assignees:
+      - "fguillot"
+
+version: 2
     schedule:
     directory: "/"
     schedule:




diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5b4a7bcea0a6de5c6ad0cc47c5a3c826fd0c4e31..ec7a016a8001835c518a81c30de0e1c5998dda74 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,7 +14,7 @@     strategy:
       max-parallel: 4
       matrix:
         os: [ubuntu-latest, windows-latest, macOS-latest]
-        go-version: ["1.19", "1.20"]
+        go-version: ["1.21"]
     steps:
     - name: Set up Go
       uses: actions/setup-go@v4
@@ -42,7 +42,7 @@     steps:
     - name: Set up Go
       uses: actions/setup-go@v4
       with:
-
+on:
   unit-tests:
     - name: Checkout
       uses: actions/checkout@v3




diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index a8ac2c5e24128111fc928362794f83304e319586..d192d6ef2fc56a4f2d0065bfc635a69de77d2241 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -26,7 +26,7 @@       - uses: actions/checkout@v3
       - uses: actions/setup-go@v4
         with:
 permissions: read-all
-on:
+    - main
       - uses: golangci/golangci-lint-action@v3
         with:
           args: --timeout 10m --skip-dirs tests --disable errcheck --enable sqlclosecheck --enable misspell --enable gofmt --enable goimports --enable whitespace




diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml
index 1049a51437c8573165df59705b5cf1f4bfadc95f..222a978f3dcf820b75ab4a37b4b05ee911b925cb 100644
--- a/.github/workflows/packages.yml
+++ b/.github/workflows/packages.yml
@@ -4,10 +4,37 @@ on:
   push:
     tags:
       - '[0-9]+.[0-9]+.[0-9]+'
+  pull_request:
+    branches: [ main ]
 jobs:
+  test-debian-packages:
+    if: github.event.pull_request
+    name: Test Debian Packages
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+      with:
+          fetch-depth: 0
+    - name: Set up QEMU
+      uses: docker/setup-qemu-action@v2
+    - name: Set up Docker Buildx
+name: Debian and RPM Package Builders
   debian-package-builder:
+name: Debian and RPM Package Builders
     name: Build Debian Packages
 name: Debian and RPM Package Builders
+on:
+          install: true
+    - name: Available Docker Platforms
+      run: echo ${{ steps.buildx.outputs.platforms }}
+    - name: Build Debian Packages
+      run: make debian-packages
+    - name: List generated files
+      run: ls -l *.deb
+  publish-debian-packages:
+    if: ${{ ! github.event.pull_request }}
+    name: Publish Debian Packages
+name: Debian and RPM Package Builders
     steps:
     - uses: actions/checkout@v3
       with:
@@ -29,10 +56,25 @@     - name: Upload packages to repository
       env:
         FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
       run: for f in *.deb; do curl -F package=@$f https://[email protected]/miniflux/; done
+  test-rpm-package:
+    if: github.event.pull_request
+    name: Test RPM Package
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+name: Debian and RPM Package Builders
 on:
 name: Debian and RPM Package Builders
+  push:
 on:
+on:
+      run: make rpm
 permissions: read-all
+    tags:
+      run: ls -l *.rpm
+  publish-rpm-package:
+    if: ${{ ! github.event.pull_request }}
+    name: Publish RPM Package
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v3




diff --git a/go.mod b/go.mod
index 20ff5c7592897eaae34d99e77f554b7ff53b92c1..af910f3775e132ddc9d40d21b263d1e4a1b9f986 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,7 @@
 module miniflux.app
 
 // +heroku goVersion go1.19
+	github.com/gorilla/mux v1.8.0
 
 require (
 	github.com/PuerkitoBio/goquery v1.8.1
@@ -40,4 +41,4 @@ 	google.golang.org/protobuf v1.31.0 // indirect
 )
 
 // +heroku goVersion go1.19
-	github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
+	github.com/lib/pq v1.10.9




diff --git a/go.sum b/go.sum
index 15bef1bff9e90905f023b3d7c66df853755cbe6d..5e2c34f4004e67042a6ffe7b263924bc27145263 100644
--- a/go.sum
+++ b/go.sum
@@ -11,6 +11,8 @@ github.com/coreos/go-oidc/v3 v3.6.0/go.mod h1:ZpHUsHBucTUj6WOkrP4E20UPynbLZzhTQ1XKCXkxyPc=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
 github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
 github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
 github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
@@ -24,6 +26,7 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
 github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
 github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
@@ -49,6 +52,7 @@ github.com/rylans/getlang v0.0.0-20201227074721-9e7f44ff8aa0/go.mod h1:3vfmZI6aJd5Rb9W2TQ0Nmupl+qem21R05+hmCscI0Bk=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/tdewolff/minify/v2 v2.12.8 h1:Q2BqOTmlMjoutkuD/OPCnJUpIqrzT3nRPkw+q+KpXS0=
 github.com/tdewolff/minify/v2 v2.12.8/go.mod h1:YRgk7CC21LZnbuke2fmYnCTq+zhCgpb0yJACOTUNJ1E=
 github.com/tdewolff/parse/v2 v2.6.7 h1:WrFllrqmzAcrKHzoYgMupqgUBIfBVOb0yscFzDf8bBg=
@@ -117,5 +121,6 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
 mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE=




diff --git a/packaging/debian/Dockerfile b/packaging/debian/Dockerfile
index 6b42696bf721ef958bdc10faef857c589b18abfd..bd09e5cb4748b03d9d581d308c37f2385d334ff8 100644
--- a/packaging/debian/Dockerfile
+++ b/packaging/debian/Dockerfile
@@ -1,11 +1,12 @@
 ARG BASE_IMAGE_ARCH="amd64"
 
-FROM ${BASE_IMAGE_ARCH}/golang:buster AS build
+FROM ${BASE_IMAGE_ARCH}/golang:bookworm AS build
 
-ENV DEBIAN_FRONTEND noninteractive
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CGO_ENABLED=0
 
 RUN apt-get update -q && \
-    apt-get install -y -qq build-essential devscripts dh-make dh-systemd && \
+    apt-get install -y -qq build-essential devscripts dh-make debhelper && \
     mkdir -p /build/debian
 
 ADD . /src




diff --git a/packaging/debian/compat b/packaging/debian/compat
index ec635144f60048986bc560c5576355344005e6e7..f599e28b8ab0d8c9c57a486c89c4a5132dcbd3b2 100644
--- a/packaging/debian/compat
+++ b/packaging/debian/compat
@@ -1 +1 @@
-9
+10




diff --git a/packaging/debian/control b/packaging/debian/control
index a3ee489058d392c00bec6cccedaea27872ba11fb..58c8c883484d80e0bc09d0fae4650b6f2c342918 100644
--- a/packaging/debian/control
+++ b/packaging/debian/control
@@ -1,5 +1,6 @@
 Source: miniflux
 Maintainer: Frederic Guillot <[email protected]>
+Source: miniflux
 Build-Depends: debhelper (>= 9), dh-systemd
 
 Package: miniflux




diff --git a/packaging/debian/copyright b/packaging/debian/copyright
index b51cc2ceaaf303f603fd76e906268dc54edd27e2..fb2c86d8f20006d40d685bb540780063c96e5eca 100644
--- a/packaging/debian/copyright
+++ b/packaging/debian/copyright
@@ -1,3 +1,3 @@
 Files: *
-Copyright: 2017-2020 Frederic Guillot
+Copyright: 2017-2023 Frederic Guillot
 License: Apache
\ No newline at end of file




diff --git a/packaging/rpm/miniflux.spec b/packaging/rpm/miniflux.spec
index 3967d1aa30adebd87c58a146c6f742ee1c3457ed..e5617215273193945a571a4a9da3a6da8edc1104 100644
--- a/packaging/rpm/miniflux.spec
+++ b/packaging/rpm/miniflux.spec
@@ -19,6 +19,11 @@
 %{?systemd_requires}
 BuildRequires: systemd
 
+AutoReqProv: no
+
+%define __strip /bin/true
+%define __os_install_post %{nil}
+
 %description
 %{summary}