mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
159 lines
5.2 KiB
YAML
159 lines
5.2 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
|
|
container:
|
|
image: ubuntu:25.04
|
|
|
|
steps:
|
|
- name: Install git
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y git ca-certificates
|
|
|
|
- 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: |
|
|
apt-get update
|
|
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
|
|
|
|
- name: Build and install Nearby Sharing API 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' \
|
|
--copt='-fvisibility=hidden' \
|
|
--cxxopt='-fvisibility-inlines-hidden' \
|
|
//sharing/linux:nearby_sharing_api_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_sharing_api_shared.so" "$INSTALL_PREFIX/lib/"
|
|
install -m 0644 "sharing/linux/nearby_sharing_api.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: Stage installer and launcher assets
|
|
run: |
|
|
STAGING="$RUNNER_TEMP/staging"
|
|
install -d "$STAGING/share/applications"
|
|
install -d "$STAGING/share/icons/hicolor/256x256/apps"
|
|
install -d "$STAGING/include/sharing/linux"
|
|
install -m 0755 sharing/linux/qml_tray_app/install_nearby_file_share.sh \
|
|
"$STAGING/install_nearby_file_share.sh"
|
|
install -m 0644 sharing/linux/qml_tray_app/nearby-file-share.desktop \
|
|
"$STAGING/share/applications/nearby-file-share.desktop"
|
|
install -m 0644 sharing/linux/qml_tray_app/nearby-linux-desktop.png \
|
|
"$STAGING/share/icons/hicolor/256x256/apps/nearby-file-share.png"
|
|
install -m 0644 sharing/linux/nearby_sharing_api.h \
|
|
"$STAGING/include/sharing/linux/nearby_sharing_api.h"
|
|
|
|
- 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: Generate SHA256 checksums
|
|
run: |
|
|
cd "$RUNNER_TEMP"
|
|
sha256sum "${{ env.tarball_name }}" > "${{ env.tarball_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
|
|
|
|
- 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
|