mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
171 lines
6.1 KiB
YAML
171 lines
6.1 KiB
YAML
name: Release Nearby QML Tray App
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
FORCE_COLOR: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-and-release-linux:
|
|
name: Build and Release Linux Bundle
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up Bazelisk
|
|
uses: bazel-contrib/setup-bazel@0.18.0
|
|
with:
|
|
# Avoid downloading Bazel every time.
|
|
bazelisk-cache: true
|
|
# Store build cache per workflow.
|
|
disk-cache: ${{ github.workflow }}
|
|
# Share repository cache between workflows.
|
|
repository-cache: true
|
|
|
|
- name: Cache apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /var/cache/apt/archives
|
|
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/release-nearby-qml-tray.yaml') }}
|
|
restore-keys: apt-${{ runner.os }}-
|
|
save-always: true
|
|
|
|
- name: Install Linux build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
clang \
|
|
cmake \
|
|
ninja-build \
|
|
pkg-config \
|
|
libsdbus-c++-dev \
|
|
libssl-dev \
|
|
libsystemd-dev \
|
|
libcurlpp-dev \
|
|
libasound2-dev \
|
|
libunistring-dev \
|
|
libldap-dev \
|
|
libkrb5-dev \
|
|
libgpg-error-dev \
|
|
libbluetooth-dev \
|
|
libxkbcommon-dev \
|
|
patchelf \
|
|
qt6-base-dev \
|
|
qt6-declarative-dev \
|
|
qt6-wayland \
|
|
qt6-tools-dev \
|
|
qt6-tools-dev-tools \
|
|
qml6-module-*
|
|
|
|
- name: Build and install Nearby shared library
|
|
id: nearby
|
|
run: |
|
|
INSTALL_PREFIX="$RUNNER_TEMP/nearby-install"
|
|
bazel build \
|
|
--check_visibility=false \
|
|
--spawn_strategy=standalone \
|
|
--verbose_failures \
|
|
--cxxopt=-std=c++20 \
|
|
--host_cxxopt=-std=c++20 \
|
|
--@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc=true \
|
|
--copt='-DGITHUB_BUILD' \
|
|
//sharing/linux:nearby_connections_service_linux_shared
|
|
BAZEL_BIN="$(bazel info bazel-bin)"
|
|
install -d "$INSTALL_PREFIX/lib"
|
|
install -d "$INSTALL_PREFIX/include/sharing/linux"
|
|
install -m 0755 "$BAZEL_BIN/sharing/linux/libnearby_connections_service_linux_shared.so" "$INSTALL_PREFIX/lib/"
|
|
install -m 0644 "sharing/linux/nearby_connections_qt_facade.h" "$INSTALL_PREFIX/include/sharing/linux/"
|
|
echo "nearby_prefix=$INSTALL_PREFIX" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Configure QML tray app
|
|
run: |
|
|
STAGING="$RUNNER_TEMP/staging"
|
|
cmake -S sharing/linux/qml_tray_app \
|
|
-B sharing/linux/qml_tray_app/build \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX="$STAGING" \
|
|
-DNEARBY_PREFIX="${{ steps.nearby.outputs.nearby_prefix }}"
|
|
|
|
- name: Build QML tray app
|
|
run: cmake --build sharing/linux/qml_tray_app/build -j
|
|
|
|
- name: Install to staging directory
|
|
run: cmake --install sharing/linux/qml_tray_app/build
|
|
|
|
- name: Package tarball
|
|
run: |
|
|
STAGING="$RUNNER_TEMP/staging"
|
|
TARBALL="nearby-file-share-linux-x86_64.tar.gz"
|
|
tar -czf "$RUNNER_TEMP/$TARBALL" -C "$STAGING" .
|
|
echo "tarball=$RUNNER_TEMP/$TARBALL" >> "$GITHUB_ENV"
|
|
echo "tarball_name=$TARBALL" >> "$GITHUB_ENV"
|
|
|
|
- name: Download linuxdeploy
|
|
run: |
|
|
cd "$RUNNER_TEMP"
|
|
curl -fSL -o linuxdeploy-x86_64.AppImage \
|
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
curl -fSL -o linuxdeploy-plugin-qt-x86_64.AppImage \
|
|
https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
|
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-qt-x86_64.AppImage
|
|
|
|
- name: Build AppImage
|
|
run: |
|
|
STAGING="$RUNNER_TEMP/staging"
|
|
NEARBY_PREFIX="${{ steps.nearby.outputs.nearby_prefix }}"
|
|
export LD_LIBRARY_PATH="$NEARBY_PREFIX/lib:${LD_LIBRARY_PATH:-}"
|
|
export QMAKE="$(which qmake6)"
|
|
export QML_SOURCES_PATHS="$GITHUB_WORKSPACE/sharing/linux/qml_tray_app"
|
|
export OUTPUT="$RUNNER_TEMP/Nearby_File_Share-x86_64.AppImage"
|
|
cp "$GITHUB_WORKSPACE/sharing/linux/qml_tray_app/tray_icon.png" \
|
|
"$RUNNER_TEMP/nearby-file-share.png"
|
|
"$RUNNER_TEMP/linuxdeploy-x86_64.AppImage" \
|
|
--appdir "$RUNNER_TEMP/AppDir" \
|
|
--executable "$STAGING/bin/nearby_qml_file_tray_app" \
|
|
--desktop-file "$GITHUB_WORKSPACE/sharing/linux/qml_tray_app/nearby-file-share.desktop" \
|
|
--icon-file "$RUNNER_TEMP/nearby-file-share.png" \
|
|
--library "$NEARBY_PREFIX/lib/libnearby_connections_service_linux_shared.so" \
|
|
--plugin qt \
|
|
--output appimage
|
|
echo "appimage=$OUTPUT" >> "$GITHUB_ENV"
|
|
echo "appimage_name=Nearby_File_Share-x86_64.AppImage" >> "$GITHUB_ENV"
|
|
|
|
- name: Generate SHA256 checksums
|
|
run: |
|
|
cd "$RUNNER_TEMP"
|
|
sha256sum "${{ env.tarball_name }}" > "${{ env.tarball_name }}.sha256"
|
|
sha256sum "${{ env.appimage_name }}" > "${{ env.appimage_name }}.sha256"
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: nearby-file-share-linux-x86_64
|
|
path: |
|
|
${{ env.tarball }}
|
|
${{ env.tarball }}.sha256
|
|
${{ env.appimage }}
|
|
${{ env.appimage }}.sha256
|
|
|
|
- name: Publish GitHub Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
${{ env.tarball }}
|
|
${{ env.tarball }}.sha256
|
|
${{ env.appimage }}
|
|
${{ env.appimage }}.sha256
|