From 707a4621de46908a0a672d36b6c639f8ded85483 Mon Sep 17 00:00:00 2001 From: KoCoder Date: Tue, 13 Jan 2026 11:27:44 +0100 Subject: [PATCH] Add .deb bundling automation --- .gitea/workflows/build-debian-package.yml | 27 +++++++++++++++++++ DEBIAN/postinst | 2 -- DEBIAN/preinst | 2 -- opt/alumnihub-helpers/.gitkeep => README.md | 0 .../DEBIAN}/control | 4 +-- alumnihub_10.0_amd64/DEBIAN/postinst | 1 + alumnihub_10.0_amd64/DEBIAN/postrm | 2 ++ alumnihub_10.0_amd64/DEBIAN/preinst | 2 ++ .../etc}/systemd/system/alumnihub.service | 0 .../opt/alumnihub-helpers}/.gitkeep | 0 alumnihub_10.0_amd64/opt/alumnihub/.gitkeep | 0 11 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 .gitea/workflows/build-debian-package.yml delete mode 100755 DEBIAN/postinst delete mode 100755 DEBIAN/preinst rename opt/alumnihub-helpers/.gitkeep => README.md (100%) rename {DEBIAN => alumnihub_10.0_amd64/DEBIAN}/control (78%) create mode 100755 alumnihub_10.0_amd64/DEBIAN/postinst create mode 100644 alumnihub_10.0_amd64/DEBIAN/postrm create mode 100755 alumnihub_10.0_amd64/DEBIAN/preinst rename {etc => alumnihub_10.0_amd64/etc}/systemd/system/alumnihub.service (100%) rename {opt/alumnihub => alumnihub_10.0_amd64/opt/alumnihub-helpers}/.gitkeep (100%) create mode 100644 alumnihub_10.0_amd64/opt/alumnihub/.gitkeep diff --git a/.gitea/workflows/build-debian-package.yml b/.gitea/workflows/build-debian-package.yml new file mode 100644 index 0000000..50483c6 --- /dev/null +++ b/.gitea/workflows/build-debian-package.yml @@ -0,0 +1,27 @@ +name: build-docker-imge +on: + - push + +jobs: + build: + name: Build the docker container + runs-on: ubuntu-latest + steps: + - name: "Git clone" + run: git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git . + - name: "Git checkout" + run: git checkout "${{ gitea.sha }}" + - name: "Dotnet SDK einrichten" + run: apt install dotnet-sdk-10.0 + - name: "Oqtane Framework auschecken" + run: git clone ${{ gitea.server_url }}/Diplomarbeit-Absolventenverein/oqtane.framework.git + - name: "Oqtane Framework bauen" + run: dotnet build -c Release ./oqtane.framework/Oqtane.slnx + - name: "Oqtane Framework publish" + run: dotnet publish -c Release ./oqtane.framework/Oqtane.slnx -o ./alumnihub_10.0_amd64/opt/alumnihub + - name: "Build .deb" + run: dpkg-deb --root-owner-group --build ./alumnihub_10.0_amd64 + - name: "Upload .deb" + run: curl --user ${{ secrets.CI_RUNNER_USER }}:${{ secrets.CI_RUNNER_TOKEN }} --upload-file ./alumnihub_10.0_amd64.deb https://git.kocoder.xyz/api/packages/Diplomarbeit-Absolventenverein/debian/pool/trixie/main/upload + + \ No newline at end of file diff --git a/DEBIAN/postinst b/DEBIAN/postinst deleted file mode 100755 index aeaf189..0000000 --- a/DEBIAN/postinst +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -systemctl daemon-reload \ No newline at end of file diff --git a/DEBIAN/preinst b/DEBIAN/preinst deleted file mode 100755 index 6359ccc..0000000 --- a/DEBIAN/preinst +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -useradd oqtane diff --git a/opt/alumnihub-helpers/.gitkeep b/README.md similarity index 100% rename from opt/alumnihub-helpers/.gitkeep rename to README.md diff --git a/DEBIAN/control b/alumnihub_10.0_amd64/DEBIAN/control similarity index 78% rename from DEBIAN/control rename to alumnihub_10.0_amd64/DEBIAN/control index e924d8c..ae9e2c8 100755 --- a/DEBIAN/control +++ b/alumnihub_10.0_amd64/DEBIAN/control @@ -1,5 +1,5 @@ -Package: oqtaneabsolventenverein -Version: 10.0 +Package: alumnihub +Version: 10.0-1 Architecture: amd64 Essential: no Priority: optional diff --git a/alumnihub_10.0_amd64/DEBIAN/postinst b/alumnihub_10.0_amd64/DEBIAN/postinst new file mode 100755 index 0000000..cc1f786 --- /dev/null +++ b/alumnihub_10.0_amd64/DEBIAN/postinst @@ -0,0 +1 @@ +#!/bin/bash \ No newline at end of file diff --git a/alumnihub_10.0_amd64/DEBIAN/postrm b/alumnihub_10.0_amd64/DEBIAN/postrm new file mode 100644 index 0000000..6848ff9 --- /dev/null +++ b/alumnihub_10.0_amd64/DEBIAN/postrm @@ -0,0 +1,2 @@ +#!/bin/bash +deluser oqtane \ No newline at end of file diff --git a/alumnihub_10.0_amd64/DEBIAN/preinst b/alumnihub_10.0_amd64/DEBIAN/preinst new file mode 100755 index 0000000..5f88fe7 --- /dev/null +++ b/alumnihub_10.0_amd64/DEBIAN/preinst @@ -0,0 +1,2 @@ +#!/bin/bash +useradd oqtane \ No newline at end of file diff --git a/etc/systemd/system/alumnihub.service b/alumnihub_10.0_amd64/etc/systemd/system/alumnihub.service similarity index 100% rename from etc/systemd/system/alumnihub.service rename to alumnihub_10.0_amd64/etc/systemd/system/alumnihub.service diff --git a/opt/alumnihub/.gitkeep b/alumnihub_10.0_amd64/opt/alumnihub-helpers/.gitkeep similarity index 100% rename from opt/alumnihub/.gitkeep rename to alumnihub_10.0_amd64/opt/alumnihub-helpers/.gitkeep diff --git a/alumnihub_10.0_amd64/opt/alumnihub/.gitkeep b/alumnihub_10.0_amd64/opt/alumnihub/.gitkeep new file mode 100644 index 0000000..e69de29