Skip to content

fix: replace deprecated withOpacity with withAlpha to pass flutter an… #12

fix: replace deprecated withOpacity with withAlpha to pass flutter an…

fix: replace deprecated withOpacity with withAlpha to pass flutter an… #12

Workflow file for this run

name: Build Linux Desktop Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libglib2.0-dev rpm zstd
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Check Flutter version
run: flutter --version
- name: Install Pub dependencies
run: flutter pub get
- name: Run Static Analysis
run: flutter analyze
- name: Run Unit Tests
run: flutter test
- name: Build Linux Desktop Release
run: |
RAW_TAG="${GITHUB_REF#refs/tags/v}"
VERSION="${RAW_TAG:-1.0.0}"
BUILD_NUM="${GITHUB_RUN_NUMBER:-1}"
flutter build linux --release --build-name=$VERSION --build-number=$BUILD_NUM
- name: Package Linux Desktop Bundles (.zip, .deb, .rpm, .pkg.tar.zst)
run: |
mkdir -p release
RAW_TAG="${GITHUB_REF#refs/tags/v}"
VERSION="${RAW_TAG:-1.0.0}"
echo "Packaging version: $VERSION"
# 1. Package ZIP Archive
cd build/linux/x64/release/bundle
zip -r ../../../../../release/bulkhead-linux-x64.zip .
cd ../../../../../
# 2. Package Debian/Ubuntu .deb
DEB_DIR="deb_dist/bulkhead_${VERSION}_amd64"
mkdir -p "$DEB_DIR/DEBIAN" "$DEB_DIR/opt/bulkhead" "$DEB_DIR/usr/bin" "$DEB_DIR/usr/share/applications"
cat <<EOF > "$DEB_DIR/DEBIAN/control"
Package: bulkhead
Version: ${VERSION}
Architecture: amd64
Maintainer: Ahmad Teeb <ahmadteeb>
Depends: libgtk-3-0, docker.io | docker
Section: utils
Priority: optional
Description: State-of-the-art Flutter Docker Engine Manager for Linux
Bulkhead is a state-of-the-art desktop Linux Docker Engine manager built with Flutter Desktop.
EOF
cp -r build/linux/x64/release/bundle/* "$DEB_DIR/opt/bulkhead/"
chmod +x "$DEB_DIR/opt/bulkhead/bulkhead"
ln -s /opt/bulkhead/bulkhead "$DEB_DIR/usr/bin/bulkhead"
cat <<EOF > "$DEB_DIR/usr/share/applications/bulkhead.desktop"
[Desktop Entry]
Name=Bulkhead
Comment=Flutter Docker Manager for Linux
Exec=/usr/bin/bulkhead
Icon=/opt/bulkhead/data/flutter_assets/assets/icon.png
Terminal=false
Type=Application
Categories=Development;System;
EOF
dpkg-deb --build "$DEB_DIR" "release/bulkhead_${VERSION}_amd64.deb"
# 3. Package RedHat/Fedora .rpm
RPM_ROOT="rpm_dist/BUILDROOT/bulkhead-${VERSION}-1.x86_64"
mkdir -p "rpm_dist/BUILD" "rpm_dist/RPMS" "rpm_dist/SOURCES" "rpm_dist/SPECS" "$RPM_ROOT/opt/bulkhead" "$RPM_ROOT/usr/bin" "$RPM_ROOT/usr/share/applications"
cp -r build/linux/x64/release/bundle/* "$RPM_ROOT/opt/bulkhead/"
chmod +x "$RPM_ROOT/opt/bulkhead/bulkhead"
ln -s /opt/bulkhead/bulkhead "$RPM_ROOT/usr/bin/bulkhead"
cat <<EOF > "$RPM_ROOT/usr/share/applications/bulkhead.desktop"
[Desktop Entry]
Name=Bulkhead
Comment=Flutter Docker Manager for Linux
Exec=/usr/bin/bulkhead
Icon=/opt/bulkhead/data/flutter_assets/assets/icon.png
Terminal=false
Type=Application
Categories=Development;System;
EOF
cat <<EOF > "rpm_dist/SPECS/bulkhead.spec"
Name: bulkhead
Version: ${VERSION}
Release: 1
Summary: State-of-the-art Flutter Docker Engine Manager for Linux
License: MIT
URL: https://github.com/ahmadteeb/Bulkhead
%description
State-of-the-art Flutter Docker Engine Manager for Linux
%files
/opt/bulkhead
/usr/bin/bulkhead
/usr/share/applications/bulkhead.desktop
EOF
rpmbuild --define "_topdir $(pwd)/rpm_dist" -bb rpm_dist/SPECS/bulkhead.spec
cp rpm_dist/RPMS/x86_64/*.rpm release/
# 4. Package Arch Linux .pkg.tar.zst
ARCH_DIR="arch_dist"
mkdir -p "$ARCH_DIR/opt/bulkhead" "$ARCH_DIR/usr/bin" "$ARCH_DIR/usr/share/applications"
cp -r build/linux/x64/release/bundle/* "$ARCH_DIR/opt/bulkhead/"
chmod +x "$ARCH_DIR/opt/bulkhead/bulkhead"
ln -s /opt/bulkhead/bulkhead "$ARCH_DIR/usr/bin/bulkhead"
cat <<EOF > "$ARCH_DIR/usr/share/applications/bulkhead.desktop"
[Desktop Entry]
Name=Bulkhead
Comment=Flutter Docker Manager for Linux
Exec=/usr/bin/bulkhead
Icon=/opt/bulkhead/data/flutter_assets/assets/icon.png
Terminal=false
Type=Application
Categories=Development;System;
EOF
BUILD_DATE=$(date +%s)
cat <<EOF > "$ARCH_DIR/.PKGINFO"
pkgname = bulkhead
pkgver = ${VERSION}-1
pkgdesc = State-of-the-art Flutter Docker Engine Manager for Linux
url = https://github.com/ahmadteeb/Bulkhead
builddate = ${BUILD_DATE}
packager = Ahmad Teeb <ahmadteeb>
arch = x86_64
license = MIT
depend = gtk3
depend = docker
EOF
cd "$ARCH_DIR"
tar -c --zstd -f "../release/bulkhead-${VERSION}-1-x86_64.pkg.tar.zst" .PKGINFO opt usr
cd ..
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: bulkhead-linux-packages
path: release/*
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}