add new debian install workflow for linux
All checks were successful
Build Slideshow App / build (amd64, .exe, windows) (push) Successful in 1m49s
Build Slideshow App / build (amd64, , linux) (push) Successful in 2m8s
Build Slideshow App / build (arm, 7, , linux) (push) Successful in 1m53s
Build Slideshow App / build (arm64, , linux) (push) Successful in 1m51s

This commit is contained in:
Adrian Zürcher
2026-01-17 22:42:16 +01:00
parent 96bfcb7d0e
commit 3aac950b9c

View File

@@ -26,7 +26,7 @@ jobs:
ext: "" ext: ""
- os: linux - os: linux
arch: arm arch: arm
arm_version: 6 arm_version: 7
ext: "" ext: ""
steps: steps:
@@ -76,18 +76,66 @@ jobs:
OUTPUT="${APP_NAME}" OUTPUT="${APP_NAME}"
if [ -n "${{ matrix.arm_version }}" ]; then if [ -n "${{ matrix.arm_version }}" ]; then
OUTPUT="${OUTPUT}v${{ matrix.arm_version }}"
export GOARM=${{ matrix.arm_version }} export GOARM=${{ matrix.arm_version }}
fi fi
OUTPUT="${OUTPUT}${{ matrix.ext }}"
OUTPUT="${OUTPUT}"
echo "Building $OUTPUT" echo "Building $OUTPUT"
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -ldflags="-s -w" -trimpath -o "$OUTPUT" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -ldflags="-s -w" -trimpath -o "$OUTPUT"
shell: bash shell: bash
- name: Upload artifact - name: Create Debian Package
if: matrix.os == 'linux'
run: |
# 1. Setup Variables
VERSION=${GITHUB_REF_NAME#v} # Extracts 1.0.0 from v1.0.0
ARCH=${{ matrix.arch }}
if [ "$ARCH" == "arm" ]; then ARCH="armhf"; fi
PKG_NAME="slideshowapp"
BUILD_DIR="${PKG_NAME}_${VERSION}_${ARCH}"
# 2. Create Directory Structure
mkdir -p $BUILD_DIR/usr/bin
mkdir -p $BUILD_DIR/usr/share/$PKG_NAME
mkdir -p $BUILD_DIR/DEBIAN
# 3. Copy Files
cp ${APP_NAME} $BUILD_DIR/usr/bin/$PKG_NAME
cp -r ./web $BUILD_DIR/usr/share/$PKG_NAME/
chmod +x $BUILD_DIR/usr/bin/$PKG_NAME
# 4. Create Control File
cat <<EOF > $BUILD_DIR/DEBIAN/control
Package: $PKG_NAME
Version: $VERSION
Section: utils
Priority: optional
Architecture: $ARCH
Maintainer: Your Name <you@example.com>
Description: Slideshow Application
EOF
# 5. Build .deb
dpkg-deb --build $BUILD_DIR
shell: bash
# Upload for Windows (Binary + Web folder)
- name: Upload Windows Artifact
if: matrix.os == 'windows'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ env.APP_NAME }}-${{ matrix.os }}-${{ matrix.arch }} name: ${{ env.APP_NAME }}-windows
path: | path: |
${{ env.APP_NAME }}.exe
./web ./web
${{env.APP_NAME}}${{ matrix.ext }}
# Upload for Linux (Binary + .deb)
- name: Upload Linux Artifact
if: matrix.os == 'linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-linux-${{ matrix.arch }}
path: |
${{ env.APP_NAME }}
*.deb