From 859b4466abbb7d9ac8603b9d26a0b6d1ade54dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Tue, 8 Aug 2023 21:54:09 -0700 Subject: [PATCH] Upgrade to Go 1.21 --- .github/dependabot.yml | 18 ++++++++++++++ .github/workflows/ci.yml | 4 +-- .github/workflows/linters.yml | 2 +- .github/workflows/packages.yml | 45 +++++++++++++++++++++++++++++++--- go.mod | 4 +-- go.sum | 4 +++ packaging/debian/Dockerfile | 7 +++--- packaging/debian/compat | 2 +- packaging/debian/control | 2 +- packaging/debian/copyright | 2 +- packaging/rpm/miniflux.spec | 5 ++++ 11 files changed, 80 insertions(+), 15 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dad80f0b..364e5974 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -27,6 +27,24 @@ updates: assignees: - "fguillot" + - package-ecosystem: "docker" + directory: "packaging/debian" + schedule: + interval: "weekly" + reviewers: + - "fguillot" + assignees: + - "fguillot" + + - package-ecosystem: "docker" + directory: "packaging/rpm" + schedule: + interval: "weekly" + reviewers: + - "fguillot" + assignees: + - "fguillot" + - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b4a7bce..ec7a016a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: 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 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - name: Checkout uses: actions/checkout@v3 - name: Install Postgres client diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index a8ac2c5e..d192d6ef 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - 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 1049a514..222a978f 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -4,9 +4,33 @@ on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' + pull_request: + branches: [ main ] jobs: - debian-package-builder: - name: Build Debian Packages + 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 + uses: docker/setup-buildx-action@v2 + id: buildx + with: + 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 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -29,8 +53,21 @@ jobs: env: FURY_TOKEN: ${{ secrets.FURY_TOKEN }} run: for f in *.deb; do curl -F package=@$f https://$FURY_TOKEN@push.fury.io/miniflux/; done - rpm-package-builder: - name: Build RPM Package + test-rpm-package: + if: github.event.pull_request + name: Test RPM Package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build RPM Package + run: make rpm + - name: List generated files + 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 20ff5c75..af910f37 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module miniflux.app -// +heroku goVersion go1.19 +// +heroku goVersion go1.21 require ( github.com/PuerkitoBio/goquery v1.8.1 @@ -39,4 +39,4 @@ require ( google.golang.org/protobuf v1.31.0 // indirect ) -go 1.19 +go 1.21 diff --git a/go.sum b/go.sum index 15bef1bf..5e2c34f4 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/coreos/go-oidc/v3 v3.6.0 h1:AKVxfYw1Gmkn/w96z0DbT/B/xFnzTd3MkZvWLjF4n 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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= 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= @@ -23,6 +24,7 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu 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= @@ -48,6 +50,7 @@ github.com/rylans/getlang v0.0.0-20201227074721-9e7f44ff8aa0/go.mod h1:3vfmZI6aJ 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= @@ -116,5 +119,6 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw 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 6b42696b..bd09e5cb 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 ec635144..f599e28b 100644 --- a/packaging/debian/compat +++ b/packaging/debian/compat @@ -1 +1 @@ -9 +10 diff --git a/packaging/debian/control b/packaging/debian/control index a3ee4890..58c8c883 100644 --- a/packaging/debian/control +++ b/packaging/debian/control @@ -1,6 +1,6 @@ Source: miniflux Maintainer: Frederic Guillot -Build-Depends: debhelper (>= 9), dh-systemd +Build-Depends: debhelper (>= 9.20160709) | dh-systemd Package: miniflux Architecture: __PKG_ARCH__ diff --git a/packaging/debian/copyright b/packaging/debian/copyright index b51cc2ce..fb2c86d8 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 3967d1aa..e5617215 100644 --- a/packaging/rpm/miniflux.spec +++ b/packaging/rpm/miniflux.spec @@ -19,6 +19,11 @@ Requires(pre): shadow-utils %{?systemd_requires} BuildRequires: systemd +AutoReqProv: no + +%define __strip /bin/true +%define __os_install_post %{nil} + %description %{summary}