Skip to content

Commit

Permalink
Script: Add build_depend.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Feb 13, 2025
1 parent 90729dd commit 1a4c60d
Show file tree
Hide file tree
Showing 19 changed files with 910 additions and 455 deletions.
166 changes: 166 additions & 0 deletions .github/workflows/aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Author: Kang Lin <[email protected]>

name: aarch64

on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_arch.outputs.name }}

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
build_arch:
if: false
strategy:
matrix:
compile_name: [deb, AppImage]
include:
- arch: aarch64
distro: ubuntu22.04

# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
# See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
# See: https://github.com/actions/runner-images/
runs-on: ubuntu-24.04

env:
BUILD_DIR: ${{github.workspace}}/build
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOLS_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install
RabbitRemoteControl_VERSION: v0.0.32
artifact_name: build_aarch64

# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true

- name: Make directories
run: |
cmake -E make_directory ${{env.BUILD_DIR}}
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: install_aarcch64

- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- uses: uraimo/run-on-arch-action@v2
name: Build deb package
id: build_deb
if: ${{matrix.compile_name == 'deb'}}
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}

# Not required, but speeds up builds
githubToken: ${{secrets.GITHUB_TOKEN}}

#setup: |

# Mount the ${{github.workspace}} directory as ${{github.workspace}} in the container
dockerRunArgs: |
--volume "${{github.workspace}}:${{github.workspace}}"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
# The shell to run commands with in the container
shell: /bin/bash

# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
# install: |
# case "${{ matrix.distro }}" in
# ubuntu*|jessie|stretch|buster|bullseye)
# ;;
# fedora*)
# #dnf -y update
# ;;
# alpine*)
# #apk update
# ;;
# esac

# Produce a binary artifact and place it in the mounted volume
run: |
${{github.workspace}}/Script/build_depend.sh \
--apt_update --base --default \
--tigervnc --pcapplusplus
--install ${{env.INSTALL_DIR}} \
--source ${{env.SOURCE_DIR}} \
--tools ${{env.TOOLS_DIR}} \
--build ${{env.BUILD_DIR}}
export PcapPlusPlus_DIR=${{env.INSTALL_DIR}}/lib/cmake/pcapplusplus
export tigervnc_DIR=${{env.INSTALL_DIR}}/lib/cmake/tigervnc
${{github.workspace}}/Script/build_debpackage.sh
- uses: uraimo/run-on-arch-action@v2
name: Build AppImag
id: build_AppImag
if: ${{matrix.compile_name == 'AppImage'}}
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}

# Not required, but speeds up builds
githubToken: ${{secrets.GITHUB_TOKEN}}

# Mount the ${{github.workspace}} directory as ${{github.workspace}} in the container
dockerRunArgs: |
--volume "${{github.workspace}}:${{github.workspace}}"
# The shell to run commands with in the container
shell: /bin/bash

# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
# Produce a binary artifact and place it in the mounted volume
run: |
${{github.workspace}}/Script/build_depend.sh \
--apt_update --base --qt \
--tigervnc --freerdp --pcapplusplus \
--install ${{env.INSTALL_DIR}} \
--source ${{env.SOURCE_DIR}} \
--tools ${{env.TOOLS_DIR}} \
--build ${{env.BUILD_DIR}}
export PcapPlusPlus_DIR=${{env.INSTALL_DIR}}/lib/cmake/pcapplusplus
export tigervnc_DIR=${{env.INSTALL_DIR}}/lib/cmake/tigervnc
export FreeRDP_DIR=${{ env.INSTALL_DIR }}/lib/cmake/FreeRDP3
export WinPR_DIR=${{ env.INSTALL_DIR }}/lib/cmake/WinPR3
export FreeRDP-Client_DIR=${{env.INSTALL_DIR}}/lib/cmake/FreeRDP-Client3
export FreeRDP-Shadow_DIR=${{env.INSTALL_DIR}}/lib/cmake/FreeRDP-Shadow3
export FreeRDP-Server_DIR=${{env.INSTALL_DIR}}/lib/cmake/FreeRDP-Server3
export BUILD_FREERDP=ON
${{github.workspace}}/Script/build_appimage.sh
34 changes: 18 additions & 16 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
BUILD_TYPE: [Release]
qt_arch: [android_arm64_v8a, android_x86_64]
qt_version: [6.8.1]
qt_version: [6.8.2]
include:
- qt_arch: android_arm64_v8a
VCPKG_TARGET_TRIPLET: arm64-android
Expand All @@ -26,7 +26,8 @@ jobs:
VCPKG_TARGET_TRIPLET: x64-android
ANDROID_ABI: x86_64

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
# See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
# See: https://github.com/actions/runner-images/
runs-on: ubuntu-24.04

Expand All @@ -37,15 +38,16 @@ jobs:
VCPKG_DEFAULT_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
VCPKG_DEFAULT_HOST_TRIPLET: x64-linux
VCPKG_MANIFEST_FEATURES: "freerdp;vnc;wol"
BUILD_DIR: ${{github.workspace}}/build
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
TOOLS_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install
artifact_name: build_android
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/26.3.11579264
ANDROID_PLATFORM: android-34
ANDROID_NATIVE_API_LEVEL: 34
ANDROID_ABI: ${{matrix.ANDROID_ABI}}
qt_modules: 'qtimageformats qtmultimedia qtscxml qtserialport qt5compat qtgraphs'
qt_modules: 'qtimageformats qtmultimedia qtscxml qtserialport qt5compat'

# Map the job outputs to step outputs
outputs:
Expand All @@ -61,14 +63,14 @@ jobs:
run: |
cmake --version
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
cmake -E make_directory ${{github.workspace}}/build
cmake -E make_directory ${{env.BUILD_DIR}}
- name: Install apt packages
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
#sudo apt-get update -y
#sudo apt-get upgrade -y
sudo apt install -y -q ninja-build nasm
- name: Cache installed
Expand All @@ -92,10 +94,10 @@ jobs:
vcpkg install --triplet ${{matrix.VCPKG_TARGET_TRIPLET}} --x-feature=vnc
- name: Install Qt of linux_gcc_64
uses: jurplel/install-qt-action@v3
if: ${{ matrix.qt_version == '6.8.1' }}
uses: jurplel/install-qt-action@v4
if: ${{ matrix.qt_version == '6.8.2' }}
with:
dir: '${{env.TOOSL_DIR}}/qt' # optional
dir: '${{env.TOOLS_DIR}}/qt' # optional
version: '${{matrix.qt_version}}'
#host: 'linux'
target: 'desktop'
Expand All @@ -104,11 +106,11 @@ jobs:
cache: true
cache-key-prefix: cached_qt

- name: Install Qt of linux_gcc_64
uses: jurplel/install-qt-action@v3
- name: Install Qt of gcc_64
uses: jurplel/install-qt-action@v4
if: ${{ matrix.qt_version == '6.6.3' }}
with:
dir: '${{env.TOOSL_DIR}}/qt' # optional
dir: '${{env.TOOLS_DIR}}/qt' # optional
version: '${{matrix.qt_version}}'
#host: 'linux'
target: 'desktop'
Expand All @@ -121,7 +123,7 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
# Directory to install Qt
dir: '${{env.TOOSL_DIR}}/qt' # optional
dir: '${{env.TOOLS_DIR}}/qt' # optional
# Version of Qt to install
version: '${{matrix.qt_version}}'
# Host platform
Expand Down Expand Up @@ -294,7 +296,7 @@ jobs:
run: git clone https://github.com/KangLin/RabbitCommon.git

- name: build RabbitRemoteControl
working-directory: ${{github.workspace}}/build
working-directory: ${{env.BUILD_DIR}}
env:
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
QT_ANDROID_KEYSTORE_PATH: ${{env.SOURCE_DIR}}/RabbitCommon/RabbitCommon.keystore
Expand Down
Loading

0 comments on commit 1a4c60d

Please sign in to comment.