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 222a978f..d137673c 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 c528c380..dee84125 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 00000000..8a6de7fd --- /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 ec7a016a..eaca7625 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 bb84153b..1a4280b0 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 2e5203a4..87eae784 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