From c980dfe434346a8ce9f953cb59873a6ec971d773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Wed, 9 Aug 2023 20:26:57 -0700 Subject: [PATCH] Update RockyLinux image from 8 to 9 Closes #2010 --- .../{packages.yml => debian_packages.yml} | 38 +++---------------- .github/workflows/docker.yml | 2 + .github/workflows/rpm_packages.yml | 37 ++++++++++++++++++ .github/workflows/{ci.yml => tests.yml} | 2 +- Makefile | 2 +- packaging/rpm/Dockerfile | 4 +- 6 files changed, 48 insertions(+), 37 deletions(-) rename .github/workflows/{packages.yml => debian_packages.yml} (59%) create mode 100644 .github/workflows/rpm_packages.yml rename .github/workflows/{ci.yml => tests.yml} (98%) diff --git a/.github/workflows/packages.yml b/.github/workflows/debian_packages.yml similarity index 59% rename from .github/workflows/packages.yml rename to .github/workflows/debian_packages.yml index 222a978f3dc..d137673c6a1 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/debian_packages.yml @@ -1,4 +1,4 @@ -name: Debian and RPM Package Builders +name: Debian Packages permissions: read-all on: push: @@ -7,9 +7,9 @@ on: pull_request: branches: [ main ] jobs: - test-debian-packages: + test-packages: if: github.event.pull_request - name: Test Debian Packages + name: Test Packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -28,9 +28,9 @@ jobs: run: make debian-packages - name: List generated files run: ls -l *.deb - publish-debian-packages: + publish-packages: if: ${{ ! github.event.pull_request }} - name: Publish Debian Packages + name: Publish Packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -53,31 +53,3 @@ 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 - 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 - with: - fetch-depth: 0 - - name: Build RPM Package - run: make rpm - - name: List generated files - run: ls -l *.rpm - - name: Upload package to repository - env: - FURY_TOKEN: ${{ secrets.FURY_TOKEN }} - run: for f in *.rpm; do curl -F package=@$f https://$FURY_TOKEN@push.fury.io/miniflux/; done diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c528c380afd..dee84125274 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,6 +10,7 @@ on: jobs: test-docker-images: if: github.event.pull_request + name: Test Images runs-on: ubuntu-latest steps: - name: Checkout @@ -35,6 +36,7 @@ jobs: publish-docker-images: if: ${{ ! github.event.pull_request }} + name: Publish Images permissions: packages: write runs-on: ubuntu-latest diff --git a/.github/workflows/rpm_packages.yml b/.github/workflows/rpm_packages.yml new file mode 100644 index 00000000000..8a6de7fdcc2 --- /dev/null +++ b/.github/workflows/rpm_packages.yml @@ -0,0 +1,37 @@ +name: RPM Packages +permissions: read-all +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + pull_request: + branches: [ main ] +jobs: + test-package: + if: github.event.pull_request + name: Test Packages + 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-package: + if: ${{ ! github.event.pull_request }} + name: Publish Packages + 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 + - name: Upload package to repository + env: + FURY_TOKEN: ${{ secrets.FURY_TOKEN }} + run: for f in *.rpm; do curl -F package=@$f https://$FURY_TOKEN@push.fury.io/miniflux/; done diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 98% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index ec7a016a800..eaca7625d35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: CI Workflow +name: Tests permissions: read-all on: diff --git a/Makefile b/Makefile index bb84153b1be..1a4280b099e 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ export PGPASSWORD := postgres debian-packages miniflux: - @ go build -buildmode=pie -ldflags=$(LD_FLAGS) -o $(APP) main.go + @ CGO_ENABLED=0 go build -buildmode=pie -ldflags=$(LD_FLAGS) -o $(APP) main.go linux-amd64: @ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-$@ main.go diff --git a/packaging/rpm/Dockerfile b/packaging/rpm/Dockerfile index 2e5203a447c..87eae784746 100644 --- a/packaging/rpm/Dockerfile +++ b/packaging/rpm/Dockerfile @@ -4,8 +4,8 @@ ADD . /go/src/app WORKDIR /go/src/app RUN make miniflux -FROM rockylinux:8 -RUN dnf install -y rpm-build +FROM rockylinux:9 +RUN dnf install -y rpm-build systemd RUN mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} RUN echo "%_topdir /root/rpmbuild" >> .rpmmacros COPY --from=build /go/src/app/miniflux /root/rpmbuild/SOURCES/miniflux