Fix icons, bundle appimage in normal workflows
This commit is contained in:
parent
d676e2e25c
commit
1cb30dda24
8 changed files with 102 additions and 232 deletions
232
.github/workflows/LANCommander.Launcher.AppImage.yml
vendored
232
.github/workflows/LANCommander.Launcher.AppImage.yml
vendored
|
|
@ -1,232 +0,0 @@
|
|||
name: LANCommander Launcher AppImage Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_semver:
|
||||
description: "Semantic Version"
|
||||
required: true
|
||||
type: string
|
||||
version_tag:
|
||||
description: 'Version Tag'
|
||||
required: true
|
||||
type: string
|
||||
build_dotnet_version:
|
||||
description: 'Build .NET Version'
|
||||
required: true
|
||||
type: string
|
||||
build_runtime:
|
||||
description: 'Build Runtime'
|
||||
required: false
|
||||
type: string
|
||||
default: 'linux-x64'
|
||||
build_arch:
|
||||
description: 'Build Architecture'
|
||||
required: false
|
||||
type: string
|
||||
default: 'x64'
|
||||
build_configuration:
|
||||
description: 'Build Configuration (Debug/Release)'
|
||||
required: false
|
||||
type: string
|
||||
default: 'Release'
|
||||
workflow_call:
|
||||
inputs:
|
||||
version_semver:
|
||||
description: "Semantic Version"
|
||||
required: true
|
||||
type: string
|
||||
version_tag:
|
||||
description: 'Version Tag'
|
||||
required: true
|
||||
type: string
|
||||
build_dotnet_version:
|
||||
description: 'Build .NET Version'
|
||||
required: true
|
||||
type: string
|
||||
build_runtime:
|
||||
description: 'Build Runtime'
|
||||
required: false
|
||||
type: string
|
||||
default: 'linux-x64'
|
||||
build_arch:
|
||||
description: 'Build Architecture'
|
||||
required: false
|
||||
type: string
|
||||
default: 'x64'
|
||||
build_configuration:
|
||||
description: 'Build Configuration (Debug/Release)'
|
||||
required: false
|
||||
type: string
|
||||
default: 'Release'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/package
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ inputs.build_arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
# Checkout code
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
# .NET Setup
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: ${{ inputs.build_dotnet_version }}
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore --locked-mode
|
||||
|
||||
- name: Publish Launcher
|
||||
run: |
|
||||
# Strip leading 'v' if present
|
||||
RAW_VERSION="${{ inputs.version_tag }}" # e.g. v2.0.0-rc1
|
||||
SEMVER="${RAW_VERSION#v}" # 2.0.0-rc1
|
||||
|
||||
# Numeric part only for Assembly/FileVersion
|
||||
NUMERIC="${SEMVER%%-*}" # 2.0.0
|
||||
ASSEMBLY_VERSION="${NUMERIC}.0" # 2.0.0.0
|
||||
|
||||
echo "SEMVER=$SEMVER"
|
||||
echo "ASSEMBLY_VERSION=$ASSEMBLY_VERSION"
|
||||
|
||||
dotnet publish "./LANCommander.Launcher/LANCommander.Launcher.csproj" \
|
||||
-c "${{ inputs.build_configuration }}" \
|
||||
--self-contained \
|
||||
--runtime "${{ inputs.build_runtime }}" \
|
||||
-p:Version="$SEMVER" \
|
||||
-p:AssemblyVersion="$ASSEMBLY_VERSION" \
|
||||
-p:FileVersion="$ASSEMBLY_VERSION" \
|
||||
-p:InformationalVersion="$SEMVER" \
|
||||
-p:PublishSingleFile=true \
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true \
|
||||
-p:IncludeAllContentForSelfExtract=true \
|
||||
-p:EnableCompressionInSingleFile=true \
|
||||
-p:DebugType=embedded
|
||||
|
||||
- name: Bundle libvlc
|
||||
shell: bash
|
||||
run: |
|
||||
PUBLISH_DIR="LANCommander.Launcher/bin/${{ inputs.build_configuration }}/net10.0/${{ inputs.build_runtime }}/publish"
|
||||
VLC_DIR="$PUBLISH_DIR/libvlc/${{ inputs.build_runtime }}"
|
||||
mkdir -p "$VLC_DIR"
|
||||
|
||||
if [ "${{ inputs.build_arch }}" = "arm64" ]; then
|
||||
sudo apt-get install -y --no-install-recommends libvlc5 libvlccore9 vlc-plugin-base
|
||||
LIB_DIR="/usr/lib/aarch64-linux-gnu"
|
||||
PLUGINS_SRC="$LIB_DIR/vlc/plugins"
|
||||
else
|
||||
sudo apt-get install -y --no-install-recommends libvlc5 libvlccore9 vlc-plugin-base
|
||||
LIB_DIR="/usr/lib/x86_64-linux-gnu"
|
||||
PLUGINS_SRC="$LIB_DIR/vlc/plugins"
|
||||
fi
|
||||
|
||||
# Copy the two core shared libraries, dereferencing symlinks so their
|
||||
# content is preserved correctly.
|
||||
for lib in libvlc.so.5 libvlccore.so.9; do
|
||||
src=$(find "$LIB_DIR" -maxdepth 1 -name "${lib}*" | sort | head -1)
|
||||
if [ -n "$src" ]; then
|
||||
cp -L "$src" "$VLC_DIR/$lib"
|
||||
echo "Bundled: $lib"
|
||||
else
|
||||
echo "WARNING: $lib not found in $LIB_DIR" >&2
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy VLC plugins (vlc-plugin-base covers common codecs and demuxers)
|
||||
if [ -d "$PLUGINS_SRC" ]; then
|
||||
mkdir -p "$VLC_DIR/plugins"
|
||||
cp -rL "$PLUGINS_SRC/." "$VLC_DIR/plugins/"
|
||||
echo "Bundled $(find "$VLC_DIR/plugins" -name "*.so" | wc -l) plugin(s)"
|
||||
fi
|
||||
|
||||
- name: Clean Build Output
|
||||
shell: bash
|
||||
run: |
|
||||
BASE_PATH="LANCommander.Launcher/bin/${{ inputs.build_configuration }}/net10.0/${{ inputs.build_runtime }}/publish"
|
||||
find "$BASE_PATH" -name '*.pdb' -delete || true
|
||||
|
||||
- name: Build AppImage
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
PUBLISH_DIR="LANCommander.Launcher/bin/${{ inputs.build_configuration }}/net10.0/${{ inputs.build_runtime }}/publish"
|
||||
APP_NAME="LANCommander.Launcher"
|
||||
APPDIR="AppDir"
|
||||
|
||||
# appimagetool / runtime architecture identifiers
|
||||
if [ "${{ inputs.build_arch }}" = "arm64" ]; then
|
||||
AI_ARCH="aarch64"
|
||||
else
|
||||
AI_ARCH="x86_64"
|
||||
fi
|
||||
export ARCH="$AI_ARCH"
|
||||
|
||||
# --- Assemble the AppDir ---------------------------------------------
|
||||
rm -rf "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/share/applications" \
|
||||
"$APPDIR/usr/share/icons/hicolor/scalable/apps"
|
||||
|
||||
cp -r "$PUBLISH_DIR/." "$APPDIR/usr/bin/"
|
||||
chmod +x "$APPDIR/usr/bin/$APP_NAME"
|
||||
|
||||
# Icon (use the prebuilt 256x256 project icon)
|
||||
ICON_SRC="LANCommander.Launcher/Assets/icon.png"
|
||||
ICON_DIR="$APPDIR/usr/share/icons/hicolor/256x256/apps"
|
||||
mkdir -p "$ICON_DIR"
|
||||
cp "$ICON_SRC" "$ICON_DIR/lancommander.png"
|
||||
|
||||
cp "$ICON_DIR/lancommander.png" "$APPDIR/lancommander.png"
|
||||
ln -sf lancommander.png "$APPDIR/.DirIcon"
|
||||
|
||||
# Desktop entry
|
||||
cat > "$APPDIR/usr/share/applications/lancommander.desktop" <<'EOF'
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=LANCommander Launcher
|
||||
Comment=LANCommander Launcher
|
||||
Exec=LANCommander.Launcher
|
||||
Icon=lancommander
|
||||
Categories=Game;
|
||||
Terminal=false
|
||||
EOF
|
||||
cp "$APPDIR/usr/share/applications/lancommander.desktop" "$APPDIR/lancommander.desktop"
|
||||
|
||||
# AppRun entry point
|
||||
cat > "$APPDIR/AppRun" <<'EOF'
|
||||
#!/bin/bash
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
export PATH="${HERE}/usr/bin:${PATH}"
|
||||
export LD_LIBRARY_PATH="${HERE}/usr/bin:${LD_LIBRARY_PATH:-}"
|
||||
exec "${HERE}/usr/bin/LANCommander.Launcher" "$@"
|
||||
EOF
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
# --- Fetch appimagetool ----------------------------------------------
|
||||
TOOL_URL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${AI_ARCH}.AppImage"
|
||||
curl -L -o appimagetool "$TOOL_URL"
|
||||
chmod +x appimagetool
|
||||
|
||||
# --- Build the AppImage ----------------------------------------------
|
||||
OUT="LANCommander.Launcher-Linux-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.AppImage"
|
||||
./appimagetool --appimage-extract-and-run "$APPDIR" "$OUT"
|
||||
|
||||
echo "Produced $OUT"
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: LANCommander.Launcher-Linux-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.AppImage
|
||||
name: LANCommander.Launcher-Linux-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.AppImage
|
||||
76
.github/workflows/LANCommander.Launcher.yml
vendored
76
.github/workflows/LANCommander.Launcher.yml
vendored
|
|
@ -220,6 +220,82 @@ jobs:
|
|||
chmod +x "$APP_DIR/Contents/MacOS/${EXECUTABLE}"
|
||||
zip -ry "LANCommander.Launcher-${{ inputs.build_platform }}-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.zip" "$APP_DIR"
|
||||
|
||||
- name: Build AppImage (Linux)
|
||||
if: inputs.build_platform == 'Linux'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
PUBLISH_DIR="LANCommander.Launcher/bin/${{ inputs.build_configuration }}/net10.0/${{ inputs.build_runtime }}/publish"
|
||||
APP_NAME="LANCommander.Launcher"
|
||||
APPDIR="AppDir"
|
||||
|
||||
# appimagetool / runtime architecture identifiers
|
||||
if [ "${{ inputs.build_arch }}" = "arm64" ]; then
|
||||
AI_ARCH="aarch64"
|
||||
else
|
||||
AI_ARCH="x86_64"
|
||||
fi
|
||||
export ARCH="$AI_ARCH"
|
||||
|
||||
# --- Assemble the AppDir ---------------------------------------------
|
||||
rm -rf "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/share/applications" \
|
||||
"$APPDIR/usr/share/icons/hicolor/scalable/apps"
|
||||
|
||||
cp -r "$PUBLISH_DIR/." "$APPDIR/usr/bin/"
|
||||
chmod +x "$APPDIR/usr/bin/$APP_NAME"
|
||||
|
||||
# Icon (use the prebuilt 256x256 project icon)
|
||||
ICON_SRC="LANCommander.Launcher/Assets/icon.png"
|
||||
ICON_DIR="$APPDIR/usr/share/icons/hicolor/256x256/apps"
|
||||
mkdir -p "$ICON_DIR"
|
||||
cp "$ICON_SRC" "$ICON_DIR/lancommander.png"
|
||||
|
||||
cp "$ICON_DIR/lancommander.png" "$APPDIR/lancommander.png"
|
||||
ln -sf lancommander.png "$APPDIR/.DirIcon"
|
||||
|
||||
# Desktop entry
|
||||
cat > "$APPDIR/usr/share/applications/lancommander.desktop" <<'EOF'
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=LANCommander Launcher
|
||||
Comment=LANCommander Launcher
|
||||
Exec=LANCommander.Launcher
|
||||
Icon=lancommander
|
||||
Categories=Game;
|
||||
Terminal=false
|
||||
EOF
|
||||
cp "$APPDIR/usr/share/applications/lancommander.desktop" "$APPDIR/lancommander.desktop"
|
||||
|
||||
# AppRun entry point
|
||||
cat > "$APPDIR/AppRun" <<'EOF'
|
||||
#!/bin/bash
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
export PATH="${HERE}/usr/bin:${PATH}"
|
||||
export LD_LIBRARY_PATH="${HERE}/usr/bin:${LD_LIBRARY_PATH:-}"
|
||||
exec "${HERE}/usr/bin/LANCommander.Launcher" "$@"
|
||||
EOF
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
# --- Fetch appimagetool ----------------------------------------------
|
||||
TOOL_URL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${AI_ARCH}.AppImage"
|
||||
curl -L -o appimagetool "$TOOL_URL"
|
||||
chmod +x appimagetool
|
||||
|
||||
# --- Build the AppImage ----------------------------------------------
|
||||
OUT="LANCommander.Launcher-Linux-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.AppImage"
|
||||
./appimagetool --appimage-extract-and-run "$APPDIR" "$OUT"
|
||||
|
||||
echo "Produced $OUT"
|
||||
|
||||
- name: Upload AppImage Artifact (Linux)
|
||||
if: inputs.build_platform == 'Linux'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: LANCommander.Launcher-Linux-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.AppImage
|
||||
name: LANCommander.Launcher-Linux-${{ inputs.build_arch }}-v${{ inputs.version_tag }}.AppImage
|
||||
|
||||
- name: Compress Build Output
|
||||
if: inputs.build_platform != 'macOS'
|
||||
shell: pwsh
|
||||
|
|
|
|||
12
.github/workflows/LANCommander.Nightly.yml
vendored
12
.github/workflows/LANCommander.Nightly.yml
vendored
|
|
@ -444,6 +444,18 @@ jobs:
|
|||
name: LANCommander.Launcher-Windows-x64-v${{ needs.prep.outputs.version_tag }}.zip
|
||||
path: artifacts
|
||||
|
||||
- name: Download Launcher Linux ARM64 AppImage
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: LANCommander.Launcher-Linux-arm64-v${{ needs.prep.outputs.version_tag }}.AppImage
|
||||
path: artifacts
|
||||
|
||||
- name: Download Launcher Linux x64 AppImage
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: LANCommander.Launcher-Linux-x64-v${{ needs.prep.outputs.version_tag }}.AppImage
|
||||
path: artifacts
|
||||
|
||||
- name: Create or update nightly release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
14
.github/workflows/LANCommander.Release.yml
vendored
14
.github/workflows/LANCommander.Release.yml
vendored
|
|
@ -305,6 +305,18 @@ jobs:
|
|||
name: LANCommander.Launcher-Windows-x64-v${{ needs.prep.outputs.version_tag }}.zip
|
||||
path: artifacts
|
||||
|
||||
- name: Download Launcher Linux ARM64 AppImage
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: LANCommander.Launcher-Linux-arm64-v${{ needs.prep.outputs.version_tag }}.AppImage
|
||||
path: artifacts
|
||||
|
||||
- name: Download Launcher Linux x64 AppImage
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: LANCommander.Launcher-Linux-x64-v${{ needs.prep.outputs.version_tag }}.AppImage
|
||||
path: artifacts
|
||||
|
||||
- name: Download Packager Windows x86
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
|
|
@ -336,6 +348,8 @@ jobs:
|
|||
artifacts/LANCommander.Launcher-macOS-x64-v${{ needs.prep.outputs.version_tag }}.zip
|
||||
artifacts/LANCommander.Launcher-Windows-arm64-v${{ needs.prep.outputs.version_tag }}.zip
|
||||
artifacts/LANCommander.Launcher-Windows-x64-v${{ needs.prep.outputs.version_tag }}.zip
|
||||
artifacts/LANCommander.Launcher-Linux-arm64-v${{ needs.prep.outputs.version_tag }}.AppImage
|
||||
artifacts/LANCommander.Launcher-Linux-x64-v${{ needs.prep.outputs.version_tag }}.AppImage
|
||||
artifacts/LANCommander.Packager-Windows-x86-v${{ needs.prep.outputs.version_tag }}.zip
|
||||
|
||||
- name: Checkout Repo for Docker build
|
||||
|
|
|
|||
BIN
LANCommander.Launcher/Assets/icon.icns
Normal file
BIN
LANCommander.Launcher/Assets/icon.icns
Normal file
Binary file not shown.
BIN
LANCommander.Launcher/Assets/icon.png
Normal file
BIN
LANCommander.Launcher/Assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
LANCommander.Server/icon.icns
Normal file
BIN
LANCommander.Server/icon.icns
Normal file
Binary file not shown.
BIN
LANCommander.Server/icon.png
Normal file
BIN
LANCommander.Server/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Loading…
Add table
Add a link
Reference in a new issue