From 45a461d6692d7cfc1f58231bc3f720181e8a4fe3 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Wed, 21 May 2025 17:16:15 -0400 Subject: [PATCH] generate Debian packages --- .github/workflows/gitea-debian.yml | 55 ++++++++++++++++++++++ .github/workflows/gitea-nightly-debian.yml | 55 ++++++++++++++++++++++ Makefile | 8 ++-- 3 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/gitea-debian.yml create mode 100644 .github/workflows/gitea-nightly-debian.yml diff --git a/.github/workflows/gitea-debian.yml b/.github/workflows/gitea-debian.yml new file mode 100644 index 0000000..46a9e9a --- /dev/null +++ b/.github/workflows/gitea-debian.yml @@ -0,0 +1,55 @@ +# Uses the stable build of Gitea to create a Debian package with pkginstall +# Triggered an hour after the Gitea stable build +# Runs on Ubuntu 22.04 + +name: Gitea Nightly Debian Build +on: + push: # Run on any push + schedule: + - cron: '0 1 * * *' # Runs daily at 1 UTC + workflow_dispatch: # Allow manual triggers + +permissions: + contents: write # Required for creating releases + +jobs: + build: + strategy: + matrix: + os: [ubuntu-22.04] + runs-on: ${{ matrix.os }} + timeout-minutes: 120 # 2-hour timeout + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.3' + cache: true + + - name: Get version + id: get_version + run: | + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/v} + else + VERSION=0.0.1-$(git rev-parse --short HEAD) + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Sleep for 15 minutes + run: sleep 900 + + - name: Generate pkg contents in "/build" + run: | + BASE=build make install + ./pkginstall build \ + --name go-gitlooseleaf \ + --version ${{ steps.get_version.outputs.version }} \ + --maintainer "idk " \ + --description "A modded gitea for hidden services" \ + --source ./build \ + --verbose \ No newline at end of file diff --git a/.github/workflows/gitea-nightly-debian.yml b/.github/workflows/gitea-nightly-debian.yml new file mode 100644 index 0000000..14e2a95 --- /dev/null +++ b/.github/workflows/gitea-nightly-debian.yml @@ -0,0 +1,55 @@ +# Uses the nightly build of Gitea to create a Debian package with pkginstall +# Triggered an hour after the Gitea nightly build +# Runs on Ubuntu 22.04 + +name: Gitea Nightly Debian Build +on: + push: # Run on any push + schedule: + - cron: '0 1 * * *' # Runs daily at 1 UTC + workflow_dispatch: # Allow manual triggers + +permissions: + contents: write # Required for creating releases + +jobs: + build: + strategy: + matrix: + os: [ubuntu-22.04] + runs-on: ${{ matrix.os }} + timeout-minutes: 120 # 2-hour timeout + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.3' + cache: true + + - name: Get version + id: get_version + run: | + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/v} + else + VERSION=0.0.1-$(git rev-parse --short HEAD) + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Sleep for 15 minutes + run: sleep 900 + + - name: Generate pkg contents in "/build" + run: | + BASE=build make install + ./pkginstall build \ + --name go-gitlooseleaf \ + --version ${{ steps.get_version.outputs.version }} \ + --maintainer "idk " \ + --description "A modded gitea for hidden services" \ + --source ./build \ + --verbose \ No newline at end of file diff --git a/Makefile b/Makefile index e3e2112..4ca4b40 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .PHONY: all download setup-user install-binary install-systemd enable disable uninstall clean help # Installation paths -BINARY_PATH = /usr/local/bin/gitea -SYSTEMD_PATH = /etc/systemd/system -CONFIG_PATH = /etc/gitea -DATA_PATH = /var/lib/gitea +BINARY_PATH = ${BASE}/usr/local/bin/gitea +SYSTEMD_PATH = ${BASE}/etc/systemd/system +CONFIG_PATH = ${BASE}/etc/gitea +DATA_PATH = ${BASE}/var/lib/gitea # Default target all: help