2023-11-04 03:41:48 +08:00
name : Build the flutter version of the RustDesk
2023-04-02 22:41:16 +08:00
on :
workflow_call :
inputs :
upload-artifact :
type : boolean
default : true
2023-07-05 21:24:44 +08:00
upload-tag :
type : string
default : "nightly"
2023-04-02 22:41:16 +08:00
2024-07-09 11:45:08 +08:00
# NOTE: F-Droid builder script 'flutter/build_fdroid.sh' reads environment
# variables from this workflow!
#
# It does NOT read build steps, however, so please fix 'flutter/build_fdroid.sh
# whenever you add changes to Android CI build action ('build-rustdesk-android')
# in this file!
2023-04-02 22:41:16 +08:00
env :
2024-07-27 16:16:31 +08:00
SCITER_RUST_VERSION : "1.75" # https://github.com/rustdesk/rustdesk/discussions/7503, also 1.78 has ABI change which causes our sciter version not working, https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
2024-06-15 14:03:33 +08:00
RUST_VERSION : "1.75" # sciter failed on m1 with 1.78 because of https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
2023-05-25 22:49:55 +08:00
CARGO_NDK_VERSION : "3.1.2"
2024-07-27 15:32:26 +08:00
SCITER_ARMV7_CMAKE_VERSION : "3.29.7"
2024-07-27 21:28:34 +08:00
SCITER_NASM_DEBVERSION : "2.14-1"
2023-04-02 22:41:16 +08:00
LLVM_VERSION : "15.0.6"
2024-11-09 20:51:47 +08:00
FLUTTER_VERSION : "3.24.4"
ANDROID_FLUTTER_VERSION : "3.24.4"
2023-11-07 20:12:22 +08:00
# for arm64 linux because official Dart SDK does not work
2024-02-11 00:15:11 +08:00
FLUTTER_ELINUX_VERSION : "3.16.9"
2023-07-05 17:47:10 +08:00
TAG_NAME : "${{ inputs.upload-tag }}"
2023-11-04 03:41:48 +08:00
VCPKG_BINARY_SOURCES : "clear;x-gha,readwrite"
2024-07-23 23:31:36 +08:00
# vcpkg version: 2024.07.12
VCPKG_COMMIT_ID : "1de2026f28ead93ff1773e6e680387643e914ea1"
2024-11-08 15:00:49 +08:00
VERSION : "1.3.3"
2024-09-23 16:43:59 +08:00
NDK_VERSION : "r27b"
2023-04-02 22:41:16 +08:00
#signing keys env variable checks
2024-03-25 11:21:01 +08:00
ANDROID_SIGNING_KEY : "${{ secrets.ANDROID_SIGNING_KEY }}"
MACOS_P12_BASE64 : "${{ secrets.MACOS_P12_BASE64 }}"
2023-04-02 22:41:16 +08:00
# To make a custom build with your own servers set the below secret values
2024-03-25 11:21:01 +08:00
RS_PUB_KEY : "${{ secrets.RS_PUB_KEY }}"
RENDEZVOUS_SERVER : "${{ secrets.RENDEZVOUS_SERVER }}"
API_SERVER : "${{ secrets.API_SERVER }}"
2023-04-02 22:41:16 +08:00
UPLOAD_ARTIFACT : "${{ inputs.upload-artifact }}"
2024-03-14 11:03:47 +08:00
SIGN_BASE_URL : "${{ secrets.SIGN_BASE_URL }}"
2023-04-02 22:41:16 +08:00
jobs :
2024-11-09 20:51:47 +08:00
generate-bridge :
uses : ./.github/workflows/bridge.yml
2024-02-26 02:24:00 +08:00
build-RustDeskTempTopMostWindow :
uses : ./.github/workflows/third-party-RustDeskTempTopMostWindow.yml
with :
2024-02-26 10:25:45 +08:00
upload-artifact : ${{ inputs.upload-artifact }}
2024-04-20 18:19:19 +08:00
target : windows-2022
2024-02-26 02:24:00 +08:00
configuration : Release
platform : x64
target_version : Windows10
strategy :
2024-03-25 11:21:01 +08:00
fail-fast : false
2024-02-26 02:24:00 +08:00
2023-04-02 22:41:16 +08:00
build-for-windows-flutter :
2024-08-01 09:12:11 +08:00
name : ${{ matrix.job.target }}
2024-11-09 20:51:47 +08:00
needs : [ build-RustDeskTempTopMostWindow, generate-bridge]
2023-04-02 22:41:16 +08:00
runs-on : ${{ matrix.job.os }}
strategy :
fail-fast : false
matrix :
job :
2024-04-20 18:19:19 +08:00
# - { target: i686-pc-windows-msvc , os: windows-2022 }
# - { target: x86_64-pc-windows-gnu , os: windows-2022 }
2024-08-01 09:12:11 +08:00
- {
target : x86_64-pc-windows-msvc,
os : windows-2022,
arch : x86_64,
vcpkg-triplet : x64-windows-static,
}
2024-04-20 18:19:19 +08:00
# - { target: aarch64-pc-windows-msvc, os: windows-2022, arch: aarch64 }
2023-04-02 22:41:16 +08:00
steps :
2023-11-04 03:41:48 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2023-04-02 22:41:16 +08:00
- name : Checkout source code
2023-12-13 21:22:38 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
2024-11-09 20:51:47 +08:00
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact
path : ./
2023-04-02 22:41:16 +08:00
- name : Install LLVM and Clang
uses : KyleMayes/install-llvm-action@v1
with :
version : ${{ env.LLVM_VERSION }}
- name : Install flutter
2024-03-04 09:17:56 +08:00
uses : subosito/flutter-action@v2.12.0 #https://github.com/subosito/flutter-action/issues/277
2023-04-02 22:41:16 +08:00
with :
channel : "stable"
flutter-version : ${{ env.FLUTTER_VERSION }}
cache : true
2024-11-09 20:51:47 +08:00
# https://github.com/flutter/flutter/issues/155685
- name : Replace engine with rustdesk custom flutter engine
run : |
flutter doctor -v
flutter precache --windows
Invoke-WebRequest -Uri https://github.com/rustdesk/engine/releases/download/main/windows-x64-release.zip -OutFile windows-x64-release.zip
Expand-Archive -Path windows-x64-release.zip -DestinationPath windows-x64-release
mv -Force windows-x64-release/* C:/hostedtoolcache/windows/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/bin/cache/artifacts/engine/windows-x64-release/
2023-04-02 22:41:16 +08:00
- name : Install Rust toolchain
2023-11-23 05:09:56 +08:00
uses : dtolnay/rust-toolchain@v1
2023-04-02 22:41:16 +08:00
with :
2024-07-27 16:16:31 +08:00
toolchain : ${{ env.SCITER_RUST_VERSION }}
2023-11-23 05:09:56 +08:00
targets : ${{ matrix.job.target }}
2024-03-27 01:48:34 +08:00
components : "rustfmt"
2023-04-02 22:41:16 +08:00
- uses : Swatinem/rust-cache@v2
with :
prefix-key : ${{ matrix.job.os }}
2023-11-04 03:41:48 +08:00
- name : Setup vcpkg with Github Actions binary cache
uses : lukka/run-vcpkg@v11
with :
vcpkgDirectory : C:\vcpkg
vcpkgGitCommitId : ${{ env.VCPKG_COMMIT_ID }}
2024-08-02 18:43:30 +08:00
doNotCache : false
2023-11-04 03:41:48 +08:00
2023-04-02 22:41:16 +08:00
- name : Install vcpkg dependencies
2024-07-23 23:31:36 +08:00
env :
VCPKG_DEFAULT_HOST_TRIPLET : ${{ matrix.job.vcpkg-triplet }}
2023-04-02 22:41:16 +08:00
run : |
2024-08-02 18:43:30 +08:00
if ! $VCPKG_ROOT/vcpkg \
install \
--triplet ${{ matrix.job.vcpkg-triplet }} \
--x-install-root="$VCPKG_ROOT/installed"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2023-11-04 03:41:48 +08:00
shell : bash
2023-04-02 22:41:16 +08:00
- name : Build rustdesk
2024-04-19 11:31:52 +08:00
run : |
Invoke-WebRequest -Uri https://github.com/rustdesk-org/rdev/releases/download/usbmmidd_v2/usbmmidd_v2.zip -OutFile usbmmidd_v2.zip
2024-04-21 14:55:42 +08:00
Expand-Archive usbmmidd_v2.zip -DestinationPath .
2024-05-06 15:26:21 +08:00
python3 .\build.py --portable --hwcodec --flutter --vram --skip-portable-pack
2024-04-21 14:55:42 +08:00
Remove-Item -Path usbmmidd_v2\Win32 -Recurse
2024-04-22 10:37:08 +08:00
Remove-Item -Path "usbmmidd_v2\deviceinstaller64.exe", "usbmmidd_v2\deviceinstaller.exe", "usbmmidd_v2\usbmmidd.bat"
2024-04-30 15:47:36 +08:00
mv ./flutter/build/windows/x64/runner/Release ./rustdesk
mv -Force .\usbmmidd_v2 ./rustdesk
2023-04-02 22:41:16 +08:00
2023-09-01 21:11:23 +08:00
- name : find Runner.res
# Windows: find Runner.res (compiled from ./flutter/windows/runner/Runner.rc), copy to ./Runner.res
# Runner.rc does not contain actual version, but Runner.res does
continue-on-error : true
shell : bash
run : |
2023-09-03 01:52:29 +08:00
runner_res=$(find . -name "Runner.res");
2023-09-02 19:29:03 +08:00
if [ "$runner_res" == "" ]; then
2023-09-03 01:52:29 +08:00
echo "Runner.res: not found";
2023-09-02 00:29:10 +08:00
else
2023-09-03 01:52:29 +08:00
echo "Runner.res: $runner_res";
cp $runner_res ./libs/portable/Runner.res;
echo "list ./libs/portable/Runner.res";
ls -l ./libs/portable/Runner.res;
2023-09-01 21:11:23 +08:00
fi
2024-02-26 02:24:00 +08:00
- name : Download RustDeskTempTopMostWindow artifacts
uses : actions/download-artifact@master
2024-02-26 10:25:45 +08:00
if : ${{ inputs.upload-artifact }}
2024-02-26 02:24:00 +08:00
with :
name : topmostwindow-artifacts
2024-04-30 15:47:36 +08:00
path : "./rustdesk"
2024-02-26 02:24:00 +08:00
2024-04-30 15:47:36 +08:00
- name : Upload unsigned
if : env.UPLOAD_ARTIFACT == 'true'
uses : actions/upload-artifact@master
with :
2024-08-01 09:12:11 +08:00
name : rustdesk-unsigned-windows-${{ matrix.job.arch }}
2024-04-30 15:47:36 +08:00
path : rustdesk
2024-03-15 23:36:03 +08:00
- name : Sign rustdesk files
if : env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != ''
shell : bash
run : |
2024-03-10 15:06:49 +08:00
pip3 install requests argparse
2024-03-15 18:07:17 +08:00
BASE_URL=${{ secrets.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./rustdesk/
2023-04-02 22:41:16 +08:00
- name : Build self-extracted executable
shell : bash
2023-07-03 17:08:50 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
run : |
2024-06-27 22:23:25 +08:00
sed -i '/dpiAware/d' res/manifest.xml
2023-04-02 22:41:16 +08:00
pushd ./libs/portable
2024-02-26 02:20:37 +08:00
pip3 install -r requirements.txt
2024-03-15 18:07:17 +08:00
python3 ./generate.py -f ../../rustdesk/ -o . -e ../../rustdesk/rustdesk.exe
2023-04-02 22:41:16 +08:00
popd
mkdir -p ./SignOutput
2023-04-03 20:35:09 +08:00
mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.exe
2023-04-02 22:41:16 +08:00
2024-04-11 18:54:32 +08:00
- name : Add MSBuild to PATH
uses : microsoft/setup-msbuild@v2
2024-04-30 09:08:08 +08:00
2024-04-11 18:54:32 +08:00
- name : Build msi
2024-04-11 20:23:08 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2024-04-11 18:54:32 +08:00
run : |
pushd ./res/msi
2024-04-19 17:57:04 +08:00
python preprocess.py --arp -d ../../rustdesk
2024-04-11 18:54:32 +08:00
nuget restore msi.sln
msbuild msi.sln -p:Configuration=Release -p:Platform=x64 /p:TargetVersion=Windows10
2024-05-09 18:09:01 +08:00
mv ./Package/bin/x64/Release/en-us/Package.msi ../../SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.msi
2024-04-11 18:54:32 +08:00
sha256sum ../../SignOutput/rustdesk-*.msi
2023-04-02 22:41:16 +08:00
- name : Sign rustdesk self-extracted file
2024-03-14 11:03:47 +08:00
if : env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != ''
2024-03-10 15:06:49 +08:00
shell : bash
run : |
BASE_URL=${{ secrets.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./SignOutput
2023-04-02 22:41:16 +08:00
- name : Publish Release
uses : softprops/action-gh-release@v1
2023-07-03 17:08:50 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
2024-04-11 18:54:32 +08:00
./SignOutput/rustdesk-*.msi
2023-04-02 22:41:16 +08:00
./SignOutput/rustdesk-*.exe
# The fallback for the flutter version, we use Sciter for 32bit Windows.
build-for-windows-sciter :
name : ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on : ${{ matrix.job.os }}
# Temporarily disable this action due to additional test is needed.
2024-03-25 11:21:01 +08:00
# if: false
2023-04-02 22:41:16 +08:00
strategy :
fail-fast : false
matrix :
job :
2024-04-20 18:19:19 +08:00
# - { target: i686-pc-windows-msvc , os: windows-2022 }
# - { target: x86_64-pc-windows-gnu , os: windows-2022 }
2024-08-01 09:12:11 +08:00
- {
target : i686-pc-windows-msvc,
os : windows-2022,
arch : x86,
vcpkg-triplet : x86-windows-static,
}
2024-04-20 18:19:19 +08:00
# - { target: aarch64-pc-windows-msvc, os: windows-2022 }
2023-04-02 22:41:16 +08:00
steps :
2023-11-04 03:41:48 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2023-04-02 22:41:16 +08:00
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
- name : Install LLVM and Clang
2023-06-24 02:59:50 +08:00
uses : rustdesk-org/install-llvm-action-32bit@master
2023-04-02 22:41:16 +08:00
with :
version : ${{ env.LLVM_VERSION }}
- name : Install Rust toolchain
2023-11-23 05:09:56 +08:00
uses : dtolnay/rust-toolchain@v1
2023-04-02 22:41:16 +08:00
with :
2024-03-27 02:22:38 +08:00
toolchain : nightly-2023-10-13-${{ matrix.job.target }} # must use nightly here, because of abi_thiscall feature required
2023-11-23 05:09:56 +08:00
targets : ${{ matrix.job.target }}
2024-03-27 01:48:34 +08:00
components : "rustfmt"
2023-04-02 22:41:16 +08:00
- uses : Swatinem/rust-cache@v2
with :
prefix-key : ${{ matrix.job.os }}-sciter
2023-11-04 03:41:48 +08:00
- name : Setup vcpkg with Github Actions binary cache
uses : lukka/run-vcpkg@v11
2023-04-02 22:41:16 +08:00
with :
2023-11-04 03:41:48 +08:00
vcpkgDirectory : C:\vcpkg
2023-04-02 22:41:16 +08:00
vcpkgGitCommitId : ${{ env.VCPKG_COMMIT_ID }}
2024-08-02 18:43:30 +08:00
doNotCache : false
2023-04-02 22:41:16 +08:00
- name : Install vcpkg dependencies
2024-07-23 23:31:36 +08:00
env :
VCPKG_DEFAULT_HOST_TRIPLET : ${{ matrix.job.vcpkg-triplet }}
2023-04-02 22:41:16 +08:00
run : |
2024-08-02 18:43:30 +08:00
if ! $VCPKG_ROOT/vcpkg \
install \
--triplet ${{ matrix.job.vcpkg-triplet }} \
--x-install-root="$VCPKG_ROOT/installed"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2023-11-04 03:41:48 +08:00
shell : bash
2023-04-02 22:41:16 +08:00
- name : Build rustdesk
id : build
shell : bash
run : |
python3 res/inline-sciter.py
# Patch sciter x86
sed -i 's/branch = "dyn"/branch = "dyn_x86"/g' ./Cargo.toml
2024-05-06 15:26:21 +08:00
cargo build --features inline,vram,hwcodec --release --bins
2023-04-02 22:41:16 +08:00
mkdir -p ./Release
mv ./target/release/rustdesk.exe ./Release/rustdesk.exe
curl -LJ -o ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll
echo "output_folder=./Release" >> $GITHUB_OUTPUT
2024-04-21 14:55:42 +08:00
curl -LJ -o ./usbmmidd_v2.zip https://github.com/rustdesk-org/rdev/releases/download/usbmmidd_v2/usbmmidd_v2.zip
unzip usbmmidd_v2.zip
2024-04-23 17:00:41 +08:00
# Do not remove x64 files, because the user may run the 32bit version on a 64bit system.
# Do not remove ./usbmmidd_v2/deviceinstaller64.exe, as x86 exe cannot install and uninstall drivers when running on x64,
# we need the x64 exe to install and uninstall the driver.
2024-08-01 09:12:11 +08:00
rm -rf ./usbmmidd_v2/deviceinstaller.exe ./usbmmidd_v2/usbmmidd.bat
2024-04-21 14:55:42 +08:00
mv ./usbmmidd_v2 ./Release || true
2023-04-02 22:41:16 +08:00
2023-09-01 21:11:23 +08:00
- name : find Runner.res
# Windows: find Runner.res (compiled from ./flutter/windows/runner/Runner.rc), copy to ./Runner.res
# Runner.rc does not contain actual version, but Runner.res does
continue-on-error : true
shell : bash
run : |
2023-09-03 01:52:29 +08:00
runner_res=$(find . -name "Runner.res");
2023-09-02 19:29:03 +08:00
if [ "$runner_res" == "" ]; then
2023-09-03 01:52:29 +08:00
echo "Runner.res: not found";
2023-09-02 00:29:10 +08:00
else
2023-09-03 01:52:29 +08:00
echo "Runner.res: $runner_res";
cp $runner_res ./libs/portable/Runner.res;
echo "list ./libs/portable/Runner.res";
ls -l ./libs/portable/Runner.res;
2023-09-01 21:11:23 +08:00
fi
2023-04-02 22:41:16 +08:00
- name : Sign rustdesk files
2024-03-14 11:03:47 +08:00
if : env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != ''
2024-03-10 15:06:49 +08:00
shell : bash
run : |
pip3 install requests argparse
BASE_URL=${{ secrets.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./Release/
2023-04-02 22:41:16 +08:00
- name : Build self-extracted executable
shell : bash
run : |
2024-06-27 22:23:25 +08:00
sed -i '/dpiAware/d' res/manifest.xml
2023-04-02 22:41:16 +08:00
pushd ./libs/portable
pip3 install -r requirements.txt
python3 ./generate.py -f ../../Release/ -o . -e ../../Release/rustdesk.exe
popd
mkdir -p ./SignOutput
2023-04-03 20:35:09 +08:00
mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}-sciter.exe
2023-11-04 03:41:48 +08:00
2023-04-02 22:41:16 +08:00
- name : Sign rustdesk self-extracted file
2024-03-14 11:03:47 +08:00
if : env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != ''
2024-03-10 15:06:49 +08:00
shell : bash
run : |
BASE_URL=${{ secrets.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./SignOutput/
2023-04-02 22:41:16 +08:00
- name : Publish Release
uses : softprops/action-gh-release@v1
2023-07-03 17:08:50 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
./SignOutput/rustdesk-*.exe
2024-04-28 12:58:15 +08:00
build-for-macOS-arm64-selfhost :
2024-04-28 12:14:00 +08:00
# use build-for-macOS instead
if : false
2024-03-17 11:17:23 +08:00
runs-on : [ self-hosted, macOS, ARM64]
2024-11-09 20:51:47 +08:00
needs : [ generate-bridge]
2024-03-17 11:17:23 +08:00
steps :
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2024-03-17 11:17:23 +08:00
2024-11-09 20:51:47 +08:00
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact-macos
path : ./
2024-03-17 11:17:23 +08:00
- name : Build rustdesk
run : |
2024-04-18 13:12:45 +08:00
./build.py --flutter --hwcodec
2024-03-25 15:43:18 +08:00
- name : create unsigned dmg
if : env.UPLOAD_ARTIFACT == 'true'
run : |
CREATE_DMG="$(command -v create-dmg)"
CREATE_DMG="$(readlink -f "$CREATE_DMG")"
sed -i -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=7/' "$CREATE_DMG"
create-dmg --icon "RustDesk.app" 200 190 --hide-extension "RustDesk.app" --window-size 800 400 --app-drop-link 600 185 rustdesk-${{ env.VERSION }}-arm64.dmg ./flutter/build/macos/Build/Products/Release/RustDesk.app
2024-03-17 11:17:23 +08:00
2024-03-25 11:21:01 +08:00
- name : Upload unsigned macOS app
if : env.UPLOAD_ARTIFACT == 'true'
uses : actions/upload-artifact@master
with :
name : rustdesk-unsigned-macos-arm64
2024-03-25 15:43:18 +08:00
path : rustdesk-${{ env.VERSION }}-arm64.dmg # can not upload the directory directly or tar.gz file, which destroy the link structure, causing the codesign failed
2024-03-25 11:21:01 +08:00
2024-03-17 11:17:23 +08:00
- name : Codesign app and create signed dmg
if : env.MACOS_P12_BASE64 != null && env.UPLOAD_ARTIFACT == 'true'
run : |
# Patch create-dmg to give more attempts to unmount image
CREATE_DMG="$(command -v create-dmg)"
CREATE_DMG="$(readlink -f "$CREATE_DMG")"
sed -i -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=7/' "$CREATE_DMG"
# start sign the rustdesk.app and dmg
2024-03-25 15:43:18 +08:00
rm -rf *.dmg || true
2024-03-17 11:17:23 +08:00
codesign --force --options runtime -s ${{ secrets.MACOS_CODESIGN_IDENTITY }} --deep --strict ./flutter/build/macos/Build/Products/Release/RustDesk.app -vvv
create-dmg --icon "RustDesk.app" 200 190 --hide-extension "RustDesk.app" --window-size 800 400 --app-drop-link 600 185 rustdesk-${{ env.VERSION }}.dmg ./flutter/build/macos/Build/Products/Release/RustDesk.app
codesign --force --options runtime -s ${{ secrets.MACOS_CODESIGN_IDENTITY }} --deep --strict rustdesk-${{ env.VERSION }}.dmg -vvv
# notarize the rustdesk-${{ env.VERSION }}.dmg
rcodesign notary-submit --api-key-path ~/.p12/api-key.json --staple rustdesk-${{ env.VERSION }}.dmg
- name : Rename rustdesk
if : env.UPLOAD_ARTIFACT == 'true'
run : |
for name in rustdesk*??.dmg; do
mv "$name" "${name%%.dmg}-aarch64.dmg"
done
- name : Publish DMG package
if : env.UPLOAD_ARTIFACT == 'true'
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
rustdesk*-aarch64.dmg
2024-04-26 19:00:38 +08:00
build-rustdesk-ios :
if : ${{ inputs.upload-artifact }}
2024-05-02 13:36:01 +08:00
name : build rustdesk ios ipa
2024-04-28 12:14:00 +08:00
runs-on : ${{ matrix.job.os }}
2024-11-09 20:51:47 +08:00
needs : [ generate-bridge]
2024-04-28 12:14:00 +08:00
strategy :
fail-fast : false
matrix :
job :
- {
arch : aarch64,
target : aarch64-apple-ios,
os : macos-13,
2024-07-03 17:57:58 +08:00
vcpkg-triplet : arm64-ios,
2024-04-28 12:14:00 +08:00
}
steps :
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name : Install dependencies
run : |
2024-07-23 23:31:36 +08:00
brew install nasm yasm
2024-04-28 12:14:00 +08:00
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2024-04-28 12:14:00 +08:00
- name : Install flutter
uses : subosito/flutter-action@v2
with :
channel : "stable"
flutter-version : ${{ env.FLUTTER_VERSION }}
- name : Setup vcpkg with Github Actions binary cache
uses : lukka/run-vcpkg@v11
with :
vcpkgGitCommitId : ${{ env.VCPKG_COMMIT_ID }}
2024-08-02 18:43:30 +08:00
doNotCache : false
2024-04-28 12:14:00 +08:00
- name : Install vcpkg dependencies
run : |
2024-08-02 18:43:30 +08:00
if ! $VCPKG_ROOT/vcpkg \
install \
--triplet ${{ matrix.job.vcpkg-triplet }} \
--x-install-root="$VCPKG_ROOT/installed"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2024-04-28 12:14:00 +08:00
shell : bash
- name : Install Rust toolchain
uses : dtolnay/rust-toolchain@v1
with :
toolchain : ${{ env.RUST_VERSION }}
targets : ${{ matrix.job.target }}
components : "rustfmt"
- uses : Swatinem/rust-cache@v2
with :
prefix-key : rustdesk-lib-cache-ios
2024-05-02 13:36:01 +08:00
key : ${{ matrix.job.target }}
2024-04-28 12:14:00 +08:00
2024-11-09 20:51:47 +08:00
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact-macos
path : ./
2024-04-28 12:14:00 +08:00
- name : Build rustdesk lib
run : |
rustup target add ${{ matrix.job.target }}
cargo build --features flutter,hwcodec --release --target aarch64-apple-ios --lib
- name : Build rustdesk
shell : bash
run : |
pushd flutter
# flutter build ipa --release --obfuscate --split-debug-info=./split-debug-info --no-codesign
# for easy debugging
flutter build ipa --release --no-codesign
# - name: Upload Artifacts
# # if: env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
# uses: actions/upload-artifact@master
# with:
# name: rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk
# path: flutter/build/ios/ipa/*.ipa
# - name: Publish ipa package
# # if: env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
# uses: softprops/action-gh-release@v1
# with:
# prerelease: true
# tag_name: ${{ env.TAG_NAME }}
# files: |
# flutter/build/ios/ipa/*.ipa
build-rustdesk-ios-selfhost :
#if: ${{ inputs.upload-artifact }}
if : false
2024-04-26 19:00:38 +08:00
runs-on : [ self-hosted, macOS, ARM64]
2024-11-09 20:51:47 +08:00
needs : [ generate-bridge]
2024-04-26 19:00:38 +08:00
strategy :
fail-fast : false
steps :
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2024-04-26 19:00:38 +08:00
# $VCPKG_ROOT/vcpkg install --triplet arm64-ios --x-install-root="$VCPKG_ROOT/installed"
2024-11-09 20:51:47 +08:00
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact-macos
path : ./
2024-04-26 19:00:38 +08:00
- name : Build rustdesk lib
run : |
cargo build --features flutter,hwcodec --release --target aarch64-apple-ios --lib
- name : Build rustdesk
2024-04-26 19:16:52 +08:00
# ios sdk not installed on this machine, I will install it later after I am back home
if : false
2024-04-26 19:00:38 +08:00
shell : bash
run : |
pushd flutter
# flutter build ipa --release --obfuscate --split-debug-info=./split-debug-info --no-codesign
# for easy debugging
flutter build ipa --release --no-codesign
# - name: Upload Artifacts
# # if: env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
# uses: actions/upload-artifact@master
# with:
# name: rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk
# path: flutter/build/ios/ipa/*.ipa
# - name: Publish ipa package
# # if: env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
# uses: softprops/action-gh-release@v1
# with:
# prerelease: true
# tag_name: ${{ env.TAG_NAME }}
# files: |
# flutter/build/ios/ipa/*.ipa
2023-04-02 22:41:16 +08:00
build-for-macOS :
2024-04-30 09:08:08 +08:00
name : ${{ matrix.job.target }}
2023-04-02 22:41:16 +08:00
runs-on : ${{ matrix.job.os }}
2024-11-09 20:51:47 +08:00
needs : [ generate-bridge]
2023-04-02 22:41:16 +08:00
strategy :
fail-fast : false
matrix :
job :
- {
target : x86_64-apple-darwin,
2024-04-28 11:43:53 +08:00
os : macos-13, #macos-latest or macos-14 use M1 now, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#:~:text=14%20GB-,macos%2Dlatest%20or%20macos%2D14,-The%20macos%2Dlatestlabel
2024-05-28 16:42:30 +08:00
extra-build-args : "" ,
2024-03-25 11:21:01 +08:00
arch : x86_64,
2023-04-02 22:41:16 +08:00
}
2024-04-28 12:14:00 +08:00
- {
2024-04-30 09:08:08 +08:00
target : aarch64-apple-darwin,
os : macos-latest,
2024-05-28 16:42:30 +08:00
# extra-build-args: "--disable-flutter-texture-render", # disable this for mac, because we see a lot of users reporting flickering both on arm and x64, and we can not confirm if texture rendering has better performance if htere is no vram, https://github.com/rustdesk/rustdesk/issues/6296
extra-build-args : "" ,
2024-04-30 09:08:08 +08:00
arch : aarch64,
2024-04-28 12:14:00 +08:00
}
2023-04-02 22:41:16 +08:00
steps :
2023-11-04 03:41:48 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2023-04-02 22:41:16 +08:00
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
- name : Import the codesign cert
if : env.MACOS_P12_BASE64 != null
uses : apple-actions/import-codesign-certs@v1
2023-11-04 03:41:48 +08:00
with :
2023-04-02 22:41:16 +08:00
p12-file-base64 : ${{ secrets.MACOS_P12_BASE64 }}
p12-password : ${{ secrets.MACOS_P12_PASSWORD }}
keychain : rustdesk
2023-11-04 03:41:48 +08:00
2023-04-02 22:41:16 +08:00
- name : Check sign and import sign key
if : env.MACOS_P12_BASE64 != null
run : |
security default-keychain -s rustdesk.keychain
security find-identity -v
- name : Import notarize key
if : env.MACOS_P12_BASE64 != null
uses : timheuer/base64-to-file@v1.2
with :
# https://gregoryszorc.com/docs/apple-codesign/stable/apple_codesign_rcodesign.html#notarizing-and-stapling
fileName : rustdesk.json
fileDir : ${{ github.workspace }}
encodedString : ${{ secrets.MACOS_NOTARIZE_JSON }}
2023-11-04 03:41:48 +08:00
2023-04-02 22:41:16 +08:00
- name : Install rcodesign tool
if : env.MACOS_P12_BASE64 != null
shell : bash
2023-11-04 03:41:48 +08:00
run : |
2023-04-02 22:41:16 +08:00
pushd /tmp
wget https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-macos-universal.tar.gz
tar -zxvf apple-codesign-0.22.0-macos-universal.tar.gz
mv apple-codesign-0.22.0-macos-universal/rcodesign /usr/local/bin
popd
- name : Install build runtime
run : |
2023-11-15 22:03:40 +08:00
brew install llvm create-dmg nasm cmake gcc wget ninja pkg-config
2023-04-02 22:41:16 +08:00
- name : Install flutter
uses : subosito/flutter-action@v2
with :
channel : "stable"
flutter-version : ${{ env.FLUTTER_VERSION }}
2024-07-17 19:13:03 +08:00
- name : Workaround for flutter issue
shell : bash
run : |
cd "$(dirname "$(which flutter)")"
# https://github.com/flutter/flutter/issues/133533
sed -i -e 's/_setFramesEnabledState(false);/\/\/_setFramesEnabledState(false);/g' ../packages/flutter/lib/src/scheduler/binding.dart
grep -n '_setFramesEnabledState(false);' ../packages/flutter/lib/src/scheduler/binding.dart
2023-04-02 22:41:16 +08:00
- name : Install Rust toolchain
2023-11-23 05:09:56 +08:00
uses : dtolnay/rust-toolchain@v1
2023-04-02 22:41:16 +08:00
with :
2024-03-27 01:32:34 +08:00
toolchain : ${{ env.RUST_VERSION }}
2023-11-23 05:09:56 +08:00
targets : ${{ matrix.job.target }}
2024-03-27 01:48:34 +08:00
components : "rustfmt"
2023-04-02 22:41:16 +08:00
- uses : Swatinem/rust-cache@v2
with :
prefix-key : ${{ matrix.job.os }}
2024-11-09 20:51:47 +08:00
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact-macos
path : ./
2023-04-02 22:41:16 +08:00
2023-11-04 03:41:48 +08:00
- name : Setup vcpkg with Github Actions binary cache
uses : lukka/run-vcpkg@v11
2023-04-02 22:41:16 +08:00
with :
vcpkgGitCommitId : ${{ env.VCPKG_COMMIT_ID }}
2024-08-02 18:43:30 +08:00
doNotCache : false
2023-04-02 22:41:16 +08:00
- name : Install vcpkg dependencies
run : |
2024-08-02 18:43:30 +08:00
if ! $VCPKG_ROOT/vcpkg \
install \
--x-install-root="$VCPKG_ROOT/installed"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2023-04-02 22:41:16 +08:00
- name : Show version information (Rust, cargo, Clang)
shell : bash
run : |
clang --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- name : Build rustdesk
run : |
2024-04-30 23:19:59 +08:00
./build.py --flutter --hwcodec ${{ matrix.job.extra-build-args }}
2024-03-25 15:43:18 +08:00
- name : create unsigned dmg
if : env.UPLOAD_ARTIFACT == 'true'
run : |
CREATE_DMG="$(command -v create-dmg)"
CREATE_DMG="$(readlink -f "$CREATE_DMG")"
sed -i -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=7/' "$CREATE_DMG"
2024-04-28 12:14:00 +08:00
create-dmg --icon "RustDesk.app" 200 190 --hide-extension "RustDesk.app" --window-size 800 400 --app-drop-link 600 185 rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.dmg ./flutter/build/macos/Build/Products/Release/RustDesk.app
2023-04-02 22:41:16 +08:00
2024-03-25 11:21:01 +08:00
- name : Upload unsigned macOS app
if : env.UPLOAD_ARTIFACT == 'true'
uses : actions/upload-artifact@master
with :
2024-04-28 12:14:00 +08:00
name : rustdesk-unsigned-macos-${{ matrix.job.arch }}
path : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.dmg # can not upload the directory directly or tar.gz, which destroy the link structure, causing the codesign failed
2024-03-25 11:21:01 +08:00
2023-04-02 22:41:16 +08:00
- name : Codesign app and create signed dmg
2023-11-22 16:43:47 +08:00
if : env.MACOS_P12_BASE64 != null && env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
run : |
2023-11-08 02:55:43 +08:00
# Patch create-dmg to give more attempts to unmount image
2023-11-09 17:48:13 +08:00
CREATE_DMG="$(command -v create-dmg)"
CREATE_DMG="$(readlink -f "$CREATE_DMG")"
sed -i -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=7/' "$CREATE_DMG"
# Unlock keychain
2023-04-02 22:41:16 +08:00
security default-keychain -s rustdesk.keychain
security unlock-keychain -p ${{ secrets.MACOS_P12_PASSWORD }} rustdesk.keychain
# start sign the rustdesk.app and dmg
2024-03-25 15:43:18 +08:00
rm -rf *.dmg || true
2024-03-20 21:20:39 +08:00
codesign --force --options runtime -s ${{ secrets.MACOS_CODESIGN_IDENTITY }} --deep --strict ./flutter/build/macos/Build/Products/Release/RustDesk.app -vvv
2023-04-02 22:41:16 +08:00
create-dmg --icon "RustDesk.app" 200 190 --hide-extension "RustDesk.app" --window-size 800 400 --app-drop-link 600 185 rustdesk-${{ env.VERSION }}.dmg ./flutter/build/macos/Build/Products/Release/RustDesk.app
2024-03-20 21:20:39 +08:00
codesign --force --options runtime -s ${{ secrets.MACOS_CODESIGN_IDENTITY }} --deep --strict rustdesk-${{ env.VERSION }}.dmg -vvv
2023-04-02 22:41:16 +08:00
# notarize the rustdesk-${{ env.VERSION }}.dmg
rcodesign notary-submit --api-key-path ${{ github.workspace }}/rustdesk.json --staple rustdesk-${{ env.VERSION }}.dmg
- name : Rename rustdesk
2023-11-22 16:43:47 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
run : |
for name in rustdesk*??.dmg; do
2023-04-03 20:35:09 +08:00
mv "$name" "${name%%.dmg}-${{ matrix.job.arch }}.dmg"
2023-04-02 22:41:16 +08:00
done
- name : Publish DMG package
2023-07-03 17:08:50 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
2023-04-03 20:35:09 +08:00
rustdesk*-${{ matrix.job.arch }}.dmg
2023-04-02 22:41:16 +08:00
2024-04-30 15:47:36 +08:00
publish_unsigned :
2024-03-25 11:21:01 +08:00
needs :
- build-for-macOS
2024-04-30 15:47:36 +08:00
- build-for-windows-flutter
2024-03-25 11:21:01 +08:00
runs-on : ubuntu-latest
if : ${{ inputs.upload-artifact }}
steps :
- name : Download artifacts
uses : actions/download-artifact@master
with :
2024-04-28 12:14:00 +08:00
name : rustdesk-unsigned-macos-x86_64
2024-03-25 15:04:34 +08:00
path : ./
2024-03-25 11:21:01 +08:00
- name : Download Artifacts
uses : actions/download-artifact@master
with :
2024-04-28 12:14:00 +08:00
name : rustdesk-unsigned-macos-aarch64
2024-03-25 15:04:34 +08:00
path : ./
2024-04-30 15:47:36 +08:00
- name : Download Artifacts
uses : actions/download-artifact@master
with :
name : rustdesk-unsigned-windows-x86_64
path : ./windows-x86_64/
2024-04-30 15:50:02 +08:00
- name : Combine unsigned app
2024-03-25 11:21:01 +08:00
run : |
2024-05-02 15:28:04 +08:00
tar czf rustdesk-${{ env.VERSION }}-unsigned.tar.gz *.dmg windows-x86_64
2024-03-25 11:21:01 +08:00
2024-04-30 15:50:02 +08:00
- name : Publish unsigned app
2024-03-25 11:21:01 +08:00
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
2024-04-30 15:50:02 +08:00
files : rustdesk-${{ env.VERSION }}-unsigned.tar.gz
2024-03-25 11:21:01 +08:00
2023-04-02 22:41:16 +08:00
build-rustdesk-android :
2024-11-09 20:51:47 +08:00
needs : [ generate-bridge]
2024-05-02 13:36:01 +08:00
name : build rustdesk android apk ${{ matrix.job.target }}
2023-04-02 22:41:16 +08:00
runs-on : ${{ matrix.job.os }}
strategy :
fail-fast : false
matrix :
job :
- {
2023-04-03 20:35:09 +08:00
arch : aarch64,
2023-04-02 22:41:16 +08:00
target : aarch64-linux-android,
os : ubuntu-20.04,
2024-07-31 20:38:00 +08:00
reltype : release,
suffix : "" ,
2023-04-02 22:41:16 +08:00
}
- {
2023-04-03 20:35:09 +08:00
arch : armv7,
2023-04-02 22:41:16 +08:00
target : armv7-linux-androideabi,
2023-04-03 20:22:17 +08:00
os : ubuntu-20.04,
2024-07-31 20:38:00 +08:00
reltype : release,
suffix : "" ,
}
- {
arch : x86_64,
target : x86_64-linux-android,
os : ubuntu-20.04,
reltype : release,
suffix : "" ,
2023-04-02 22:41:16 +08:00
}
steps :
2024-08-04 12:34:08 +08:00
- name : Free Disk Space (Ubuntu)
uses : jlumbroso/free-disk-space@main
with :
tool-cache : false
android : false
dotnet : true
haskell : true
large-packages : false
docker-images : true
swap-storage : false
2023-11-04 03:41:48 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2023-04-02 22:41:16 +08:00
- name : Install dependencies
run : |
2023-11-04 03:41:48 +08:00
sudo apt-get update
sudo apt-get install -y \
clang \
cmake \
curl \
gcc-multilib \
git \
g++ \
g++-multilib \
2024-09-15 14:33:59 +08:00
libayatana-appindicator3-dev \
2023-11-04 03:41:48 +08:00
libasound2-dev \
libc6-dev \
libclang-10-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
libpam0g-dev \
libpulse-dev \
libva-dev \
libvdpau-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxdo-dev \
libxfixes-dev \
llvm-10-dev \
nasm \
ninja-build \
2024-11-09 20:51:47 +08:00
openjdk-17-jdk-headless \
2023-11-04 03:41:48 +08:00
pkg-config \
tree \
2023-11-15 22:03:40 +08:00
wget
2023-11-04 03:41:48 +08:00
2023-04-02 22:41:16 +08:00
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
- name : Install flutter
uses : subosito/flutter-action@v2
with :
channel : "stable"
2024-06-21 18:14:58 +08:00
flutter-version : ${{ env.ANDROID_FLUTTER_VERSION }}
2023-04-02 22:41:16 +08:00
- uses : nttld/setup-ndk@v1
id : setup-ndk
with :
ndk-version : ${{ env.NDK_VERSION }}
add-to-path : true
2023-11-04 03:41:48 +08:00
- name : Setup vcpkg with Github Actions binary cache
uses : lukka/run-vcpkg@v11
with :
vcpkgDirectory : /opt/artifacts/vcpkg
vcpkgGitCommitId : ${{ env.VCPKG_COMMIT_ID }}
2024-08-02 18:43:30 +08:00
doNotCache : false
2023-11-04 03:41:48 +08:00
- name : Install vcpkg dependencies
2023-04-02 22:41:16 +08:00
run : |
2023-11-04 03:41:48 +08:00
case ${{ matrix.job.target }} in
aarch64-linux-android)
2024-08-02 18:43:30 +08:00
ANDROID_TARGET=arm64-v8a
2023-11-04 03:41:48 +08:00
;;
armv7-linux-androideabi)
2024-08-02 18:43:30 +08:00
ANDROID_TARGET=armeabi-v7a
2023-11-04 03:41:48 +08:00
;;
2024-07-31 20:38:00 +08:00
x86_64-linux-android)
2024-08-02 18:43:30 +08:00
ANDROID_TARGET=x86_64
2024-07-31 20:38:00 +08:00
;;
i686-linux-android)
2024-08-02 18:43:30 +08:00
ANDROID_TARGET=x86
2024-07-31 20:38:00 +08:00
;;
2023-11-04 03:41:48 +08:00
esac
2024-08-02 18:43:30 +08:00
if ! ./flutter/build_android_deps.sh "${ANDROID_TARGET}"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2023-11-04 03:41:48 +08:00
shell : bash
2023-04-02 22:41:16 +08:00
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact
path : ./
- name : Install Rust toolchain
2023-11-23 05:09:56 +08:00
uses : dtolnay/rust-toolchain@v1
2023-04-02 22:41:16 +08:00
with :
2024-03-27 01:32:34 +08:00
toolchain : ${{ env.RUST_VERSION }}
2024-03-27 01:48:34 +08:00
components : "rustfmt"
2023-04-02 22:41:16 +08:00
- uses : Swatinem/rust-cache@v2
with :
2023-11-04 03:41:48 +08:00
prefix-key: rustdesk-lib-cache-android # TODO : drop '-android' part after caches are invalidated
2024-05-02 13:36:01 +08:00
key : ${{ matrix.job.target }}
2023-04-02 22:41:16 +08:00
2024-06-21 18:14:58 +08:00
- name : fix android for flutter 3.13
2024-11-09 20:51:47 +08:00
if : ${{ env.ANDROID_FLUTTER_VERSION == '3.13.9' }}
2024-06-21 18:14:58 +08:00
run : |
2024-08-25 20:46:21 +08:00
cd flutter
sed -i 's/uni_links_desktop/#uni_links_desktop/g' pubspec.yaml
sed -i 's/extended_text: .*/extended_text : 11.1 .0 /' pubspec.yaml
flutter pub get
cd lib
2024-06-21 18:14:58 +08:00
find . | grep dart | xargs sed -i 's/textScaler: TextScaler.linear(\(.*\)),/textScaleFactor : \1,/g'
2023-04-02 22:41:16 +08:00
- name : Build rustdesk lib
env :
ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
ANDROID_NDK_ROOT : ${{ steps.setup-ndk.outputs.ndk-path }}
run : |
2023-11-04 03:41:48 +08:00
rustup target add ${{ matrix.job.target }}
2023-05-25 22:49:55 +08:00
cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }}
2023-04-02 22:41:16 +08:00
case ${{ matrix.job.target }} in
aarch64-linux-android)
./flutter/ndk_arm64.sh
mkdir -p ./flutter/android/app/src/main/jniLibs/arm64-v8a
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so
;;
armv7-linux-androideabi)
./flutter/ndk_arm.sh
mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so
;;
2024-07-31 20:38:00 +08:00
x86_64-linux-android)
./flutter/ndk_x64.sh
mkdir -p ./flutter/android/app/src/main/jniLibs/x86_64
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so
;;
i686-linux-android)
./flutter/ndk_x86.sh
mkdir -p ./flutter/android/app/src/main/jniLibs/x86
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so
;;
2023-04-02 22:41:16 +08:00
esac
2024-08-03 18:39:12 +08:00
- name : Upload Rustdesk library to Artifacts
uses : actions/upload-artifact@master
with :
name : librustdesk.so.${{ matrix.job.target }}
path : ./target/${{ matrix.job.target }}/release/liblibrustdesk.so
2023-04-02 22:41:16 +08:00
- name : Build rustdesk
shell : bash
env :
2024-11-09 20:51:47 +08:00
JAVA_HOME : /usr/lib/jvm/java-17-openjdk-amd64
2023-04-02 22:41:16 +08:00
run : |
2024-11-09 20:51:47 +08:00
export PATH=/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH
2023-04-02 22:41:16 +08:00
# temporary use debug sign config
sed -i "s/signingConfigs.release/signingConfigs.debug/g" ./flutter/android/app/build.gradle
case ${{ matrix.job.target }} in
aarch64-linux-android)
mkdir -p ./flutter/android/app/src/main/jniLibs/arm64-v8a
2023-11-04 03:41:48 +08:00
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/
2023-04-02 22:41:16 +08:00
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so
# build flutter
pushd flutter
2024-07-31 20:38:00 +08:00
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-arm64 --split-per-abi
mv build/app/outputs/flutter-apk/app-arm64-v8a-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk
2023-04-02 22:41:16 +08:00
;;
armv7-linux-androideabi)
mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a
2023-11-04 03:41:48 +08:00
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/libc++_shared.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/
2023-04-02 22:41:16 +08:00
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so
# build flutter
pushd flutter
2024-07-31 20:38:00 +08:00
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-arm --split-per-abi
mv build/app/outputs/flutter-apk/app-armeabi-v7a-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk
;;
x86_64-linux-android)
mkdir -p ./flutter/android/app/src/main/jniLibs/x86_64
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86_64/
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so
# build flutter
pushd flutter
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-x64 --split-per-abi
mv build/app/outputs/flutter-apk/app-x86_64-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk
;;
i686-linux-android)
mkdir -p ./flutter/android/app/src/main/jniLibs/x86
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86/
2024-08-01 15:09:33 +08:00
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so
2024-07-31 20:38:00 +08:00
# build flutter
pushd flutter
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-x86 --split-per-abi
mv build/app/outputs/flutter-apk/app-x86-${{ matrix.job.reltype }}.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk
2023-04-02 22:41:16 +08:00
;;
esac
popd
mkdir -p signed-apk; pushd signed-apk
2024-07-31 20:38:00 +08:00
mv ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk .
2023-11-04 03:41:48 +08:00
2023-04-02 22:41:16 +08:00
- uses : r0adkll/sign-android-release@v1
name : Sign app APK
if : env.ANDROID_SIGNING_KEY != null
id : sign-rustdesk
with :
releaseDirectory : ./signed-apk
signingKeyBase64 : ${{ secrets.ANDROID_SIGNING_KEY }}
alias : ${{ secrets.ANDROID_ALIAS }}
keyStorePassword : ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
2024-08-03 18:39:12 +08:00
keyPassword : ${{ secrets.ANDROID_KEY_PASSWORD }}
env :
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION : "30.0.2"
- name : Upload Artifacts
if : env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
uses : actions/upload-artifact@master
with :
name : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk
path : ${{steps.sign-rustdesk.outputs.signedReleaseFile}}
- name : Publish signed apk package
if : env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
${{steps.sign-rustdesk.outputs.signedReleaseFile}}
- name : Publish unsigned apk package
if : env.ANDROID_SIGNING_KEY == null && env.UPLOAD_ARTIFACT == 'true'
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
signed-apk/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk
build-rustdesk-android-universal :
needs : [ build-rustdesk-android]
name : build rustdesk android universal apk
2024-08-04 16:32:05 +08:00
if : ${{ inputs.upload-artifact }}
2024-08-03 18:39:12 +08:00
runs-on : ubuntu-20.04
env :
reltype : release
2024-08-04 12:34:08 +08:00
x86_target : "" # can be ",android-x86"
suffix : ""
2024-08-03 18:39:12 +08:00
steps :
2024-08-04 12:34:08 +08:00
- name : Free Disk Space (Ubuntu)
uses : jlumbroso/free-disk-space@main
with :
tool-cache : false
android : false
dotnet : true
haskell : true
large-packages : false
docker-images : true
swap-storage : false
2024-08-03 18:39:12 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name : Install dependencies
run : |
sudo apt-get update
sudo apt-get install -y \
clang \
cmake \
curl \
gcc-multilib \
git \
g++ \
g++-multilib \
2024-09-15 14:33:59 +08:00
libayatana-appindicator3-dev \
2024-08-03 18:39:12 +08:00
libasound2-dev \
libc6-dev \
libclang-10-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
libpam0g-dev \
libpulse-dev \
libva-dev \
libvdpau-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxdo-dev \
libxfixes-dev \
llvm-10-dev \
nasm \
ninja-build \
2024-11-09 20:51:47 +08:00
openjdk-17-jdk-headless \
2024-08-03 18:39:12 +08:00
pkg-config \
tree \
wget
- name : Checkout source code
uses : actions/checkout@v4
- name : Install flutter
uses : subosito/flutter-action@v2
with :
channel : "stable"
flutter-version : ${{ env.ANDROID_FLUTTER_VERSION }}
- name : Restore bridge files
uses : actions/download-artifact@master
with :
name : bridge-artifact
path : ./
- name : Download Rustdesk library from Artifacts
uses : actions/download-artifact@master
with :
name : librustdesk.so.aarch64-linux-android
2024-08-04 12:34:08 +08:00
path : ./flutter/android/app/src/main/jniLibs/arm64-v8a
2024-08-03 18:39:12 +08:00
- name : Download Rustdesk library from Artifacts
uses : actions/download-artifact@master
with :
name : librustdesk.so.armv7-linux-androideabi
2024-08-04 12:34:08 +08:00
path : ./flutter/android/app/src/main/jniLibs/armeabi-v7a
2024-08-03 18:39:12 +08:00
- name : Download Rustdesk library from Artifacts
uses : actions/download-artifact@master
with :
name : librustdesk.so.x86_64-linux-android
2024-08-04 12:34:08 +08:00
path : ./flutter/android/app/src/main/jniLibs/x86_64
- name : Download Rustdesk library from Artifacts
if : ${{ env.reltype == 'debug' }}
uses : actions/download-artifact@master
with :
name : librustdesk.so.i686-linux-android
path : ./flutter/android/app/src/main/jniLibs/x86
2024-08-03 18:39:12 +08:00
- name : fix android for flutter 3.13
2024-11-09 20:51:47 +08:00
if : ${{ env.ANDROID_FLUTTER_VERSION == '3.13.9' }}
2024-08-03 18:39:12 +08:00
run : |
2024-08-25 20:46:21 +08:00
cd flutter
sed -i 's/uni_links_desktop/#uni_links_desktop/g' pubspec.yaml
sed -i 's/extended_text: .*/extended_text : 11.1 .0 /' pubspec.yaml
flutter pub get
cd lib
2024-08-03 18:39:12 +08:00
find . | grep dart | xargs sed -i 's/textScaler: TextScaler.linear(\(.*\)),/textScaleFactor : \1,/g'
- name : Build rustdesk
shell : bash
env :
2024-11-09 20:51:47 +08:00
JAVA_HOME : /usr/lib/jvm/java-17-openjdk-amd64
2024-08-03 18:39:12 +08:00
run : |
2024-11-09 20:51:47 +08:00
export PATH=/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH
2024-08-03 18:39:12 +08:00
# temporary use debug sign config
sed -i "s/signingConfigs.release/signingConfigs.debug/g" ./flutter/android/app/build.gradle
2024-08-04 12:34:08 +08:00
mv ./flutter/android/app/src/main/jniLibs/arm64-v8a/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so
2024-08-03 18:39:12 +08:00
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/
2024-08-04 12:34:08 +08:00
mv ./flutter/android/app/src/main/jniLibs/armeabi-v7a/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so
2024-08-03 18:39:12 +08:00
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/libc++_shared.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/
2024-08-04 12:34:08 +08:00
mv ./flutter/android/app/src/main/jniLibs/x86_64/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so
2024-08-03 18:39:12 +08:00
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86_64/
2024-08-04 12:34:08 +08:00
if [ "${{ env.reltype }}" = "debug" ]; then
mv ./flutter/android/app/src/main/jniLibs/x86/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86/
fi
2024-08-03 18:39:12 +08:00
# build flutter
pushd flutter
2024-08-04 12:34:08 +08:00
flutter build apk "--${{ env.reltype }}" --target-platform android-arm64,android-arm,android-x64${{ env.x86_target }}
popd
2024-08-03 18:39:12 +08:00
mkdir -p signed-apk
2024-08-04 12:34:08 +08:00
mv ./flutter/build/app/outputs/flutter-apk/app-${{ env.reltype }}.apk signed-apk/rustdesk-${{ env.VERSION }}-universal${{ env.suffix }}.apk
2024-08-03 18:39:12 +08:00
- uses : r0adkll/sign-android-release@v1
name : Sign app APK
if : env.ANDROID_SIGNING_KEY != null
id : sign-rustdesk
with :
releaseDirectory : ./signed-apk
signingKeyBase64 : ${{ secrets.ANDROID_SIGNING_KEY }}
alias : ${{ secrets.ANDROID_ALIAS }}
keyStorePassword : ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
2023-04-02 22:41:16 +08:00
keyPassword : ${{ secrets.ANDROID_KEY_PASSWORD }}
env :
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION : "30.0.2"
- name : Upload Artifacts
2023-07-03 17:08:50 +08:00
if : env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
uses : actions/upload-artifact@master
with :
2023-04-03 20:35:09 +08:00
name : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.apk
2023-04-02 22:41:16 +08:00
path : ${{steps.sign-rustdesk.outputs.signedReleaseFile}}
- name : Publish signed apk package
2023-07-03 17:08:50 +08:00
if : env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
${{steps.sign-rustdesk.outputs.signedReleaseFile}}
- name : Publish unsigned apk package
2023-07-03 17:08:50 +08:00
if : env.ANDROID_SIGNING_KEY == null && env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
2024-08-04 12:34:08 +08:00
signed-apk/rustdesk-${{ env.VERSION }}-universal${{ env.suffix }}.apk
2023-04-02 22:41:16 +08:00
2024-05-02 13:23:32 +08:00
build-rustdesk-linux :
2024-11-09 20:51:47 +08:00
needs : [ generate-bridge]
2024-08-01 09:12:11 +08:00
name : build rustdesk linux ${{ matrix.job.target }}
2024-04-30 09:08:08 +08:00
runs-on : ${{ matrix.job.on }}
2023-04-02 22:41:16 +08:00
strategy :
fail-fast : false
matrix :
# use a high level qemu-user-static
job :
- {
arch : x86_64,
target : x86_64-unknown-linux-gnu,
2024-04-30 09:08:08 +08:00
distro : ubuntu18.04,
on : ubuntu-20.04,
2024-07-02 00:19:18 +08:00
deb_arch : amd64,
2024-07-03 17:57:58 +08:00
vcpkg-triplet : x64-linux,
2023-04-02 22:41:16 +08:00
}
- {
arch : aarch64,
target : aarch64-unknown-linux-gnu,
2024-04-30 09:08:08 +08:00
distro : ubuntu18.04,
on : [ self-hosted, Linux, ARM64],
2024-07-02 00:19:18 +08:00
deb_arch : arm64,
2024-07-03 17:57:58 +08:00
vcpkg-triplet : arm64-linux,
2023-04-02 22:41:16 +08:00
}
steps :
2023-11-04 03:41:48 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2024-04-30 09:08:08 +08:00
- name : Maximize build space
if : ${{ matrix.job.arch == 'x86_64' }}
2023-11-04 03:41:48 +08:00
run : |
2024-04-30 09:08:08 +08:00
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo apt-get update -y
sudo apt-get install -y nasm qemu-user-static
2023-04-02 22:41:16 +08:00
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
2024-04-30 09:08:08 +08:00
- name : Set Swap Space
if : ${{ matrix.job.arch == 'x86_64' }}
uses : pierotofy/set-swap-space@master
with :
swap-size-gb : 12
2023-04-02 22:41:16 +08:00
- name : Free Space
run : |
2023-08-19 17:41:28 +08:00
df -h
free -m
2023-04-02 22:41:16 +08:00
- name : Install Rust toolchain
2023-11-23 05:09:56 +08:00
uses : dtolnay/rust-toolchain@v1
2024-06-28 23:32:23 +08:00
if : matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
with :
2024-03-27 01:32:34 +08:00
toolchain : ${{ env.RUST_VERSION }}
2023-11-23 05:09:56 +08:00
targets : ${{ matrix.job.target }}
2024-03-27 01:48:34 +08:00
components : "rustfmt"
2023-11-04 03:41:48 +08:00
2023-07-17 07:52:18 +08:00
- name : Save Rust toolchain version
run : |
RUST_TOOLCHAIN_VERSION=$(cargo --version | awk '{print $2}')
echo "RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION" >> $GITHUB_ENV
2023-04-02 22:41:16 +08:00
- name : Disable rust bridge build
run : |
# only build cdylib
sed -i "s/\[\"cdylib\", \"staticlib\", \"rlib\"\]/\[\"cdylib\"\]/g" Cargo.toml
- name : Restore bridge files
2024-06-28 23:32:23 +08:00
if : matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
uses : actions/download-artifact@master
with :
name : bridge-artifact
path : ./
2023-11-04 03:41:48 +08:00
- name : Setup vcpkg with Github Actions binary cache
2024-06-28 23:32:23 +08:00
if : matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
2023-11-04 03:41:48 +08:00
uses : lukka/run-vcpkg@v11
2023-04-02 22:41:16 +08:00
with :
2023-11-04 03:41:48 +08:00
vcpkgDirectory : /opt/artifacts/vcpkg
vcpkgGitCommitId : ${{ env.VCPKG_COMMIT_ID }}
2024-08-02 18:43:30 +08:00
doNotCache : false
2023-11-04 03:41:48 +08:00
- name : Install vcpkg dependencies
2024-06-28 23:32:23 +08:00
if : matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
2023-11-04 03:41:48 +08:00
run : |
2024-08-02 18:43:30 +08:00
if ! $VCPKG_ROOT/vcpkg \
install \
--triplet ${{ matrix.job.vcpkg-triplet }} \
--x-install-root="$VCPKG_ROOT/installed"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2023-11-04 03:41:48 +08:00
shell : bash
2023-04-02 22:41:16 +08:00
2024-05-02 13:23:32 +08:00
- name : Restore bridge files
2024-06-28 23:32:23 +08:00
if : matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
2024-05-02 13:23:32 +08:00
uses : actions/download-artifact@master
with :
name : bridge-artifact
path : ./
2023-06-24 02:59:50 +08:00
- uses : rustdesk-org/run-on-arch-action@amd64-support
2024-05-02 13:46:01 +08:00
name : Build rustdesk
2023-04-02 22:41:16 +08:00
id : vcpkg
2024-06-28 23:32:23 +08:00
if : matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
with :
arch : ${{ matrix.job.arch }}
2024-04-30 09:08:08 +08:00
distro : ${{ matrix.job.distro }}
2023-04-02 22:41:16 +08:00
githubToken : ${{ github.token }}
setup : |
ls -l "${PWD}"
ls -l /opt/artifacts/vcpkg/installed
dockerRunArgs : |
--volume "${PWD}:/workspace"
--volume "/opt/artifacts:/opt/artifacts"
shell : /bin/bash
install : |
2023-11-04 03:41:48 +08:00
apt-get update -y
2023-04-02 22:41:16 +08:00
echo -e "installing deps"
2023-11-04 03:41:48 +08:00
apt-get install -y \
2024-05-02 13:23:32 +08:00
build-essential \
2023-11-04 03:41:48 +08:00
clang \
cmake \
curl \
gcc \
git \
g++ \
2024-09-15 14:33:59 +08:00
libayatana-appindicator3-dev \
2023-11-04 03:41:48 +08:00
libasound2-dev \
libclang-10-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
libpam0g-dev \
libpulse-dev \
libva-dev \
libvdpau-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxdo-dev \
libxfixes-dev \
llvm-10-dev \
nasm \
ninja-build \
pkg-config \
tree \
2024-05-02 13:23:32 +08:00
python3 \
rpm \
unzip \
wget \
xz-utils
2023-04-02 22:41:16 +08:00
# we have libopus compiled by us.
2023-11-04 03:41:48 +08:00
apt-get remove -y libopus-dev || true
2023-04-02 22:41:16 +08:00
# output devs
ls -l ./
tree -L 3 /opt/artifacts/vcpkg/installed
run : |
# disable git safe.directory
git config --global --add safe.directory "*"
# rust
pushd /opt
2023-05-12 11:20:22 +08:00
# do not use rustup, because memory overflow in qemu
2023-07-17 07:52:18 +08:00
wget -O rust.tar.gz https://static.rust-lang.org/dist/rust-${{env.RUST_TOOLCHAIN_VERSION}}-${{ matrix.job.target }}.tar.gz
2023-04-02 22:41:16 +08:00
tar -zxvf rust.tar.gz > /dev/null && rm rust.tar.gz
2023-07-17 07:52:18 +08:00
cd rust-${{env.RUST_TOOLCHAIN_VERSION}}-${{ matrix.job.target }} && ./install.sh
rm -rf rust-${{env.RUST_TOOLCHAIN_VERSION}}-${{ matrix.job.target }}
2023-04-02 22:41:16 +08:00
# edit config
mkdir -p ~/.cargo/
echo """
[ source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
"" " > ~/.cargo/config
cat ~/.cargo/config
# start build
pushd /workspace
export VCPKG_ROOT=/opt/artifacts/vcpkg
2024-04-30 22:41:45 +08:00
if [[ "${{ matrix.job.arch }}" == "aarch64" ]]; then
2024-05-01 10:20:11 +08:00
export JOBS="--jobs 3"
2024-04-30 22:41:45 +08:00
else
export JOBS=""
fi
2024-04-30 23:14:16 +08:00
echo $JOBS
2024-05-28 16:42:30 +08:00
cargo build --lib $JOBS --features hwcodec,flutter --release
2024-05-10 14:03:40 +08:00
rm -rf target/release/deps target/release/build
rm -rf ~/.cargo
2023-04-02 22:41:16 +08:00
2024-05-02 14:57:17 +08:00
# Setup Flutter
2024-05-02 13:23:32 +08:00
# disable git safe.directory
git config --global --add safe.directory "*"
pushd /workspace
case ${{ matrix.job.arch }} in
aarch64)
export PATH=/opt/flutter-elinux/bin:$PATH
sed -i "s/flutter build linux --release/flutter-elinux build linux --verbose/g" ./build.py
sed -i "s/x64\/release/arm64\/release/g" ./build.py
;;
x86_64)
export PATH=/opt/flutter/bin:$PATH
;;
esac
popd
pushd /opt
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz
tar xf flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz
case ${{ matrix.job.arch }} in
aarch64)
# clone repo and reset to flutter ${{ env.FLUTTER_VERSION }}
git clone https://github.com/sony/flutter-elinux.git || true
pushd flutter-elinux
git fetch
git reset --hard ${{ env.FLUTTER_VERSION }}
bin/flutter-elinux doctor -v
bin/flutter-elinux precache --linux
popd
cp -R flutter/bin/cache/artifacts/engine/linux-x64/shader_lib flutter-elinux/flutter/bin/cache/artifacts/engine/linux-arm64
2024-05-10 14:03:40 +08:00
rm -rf flutter
2024-05-02 13:23:32 +08:00
;;
x86_64)
flutter doctor -v
;;
esac
2024-05-02 14:57:17 +08:00
# build flutter
2024-05-02 13:23:32 +08:00
pushd /workspace
export CARGO_INCREMENTAL=0
2024-07-02 00:19:18 +08:00
export DEB_ARCH=${{ matrix.job.deb_arch }}
2024-05-02 13:23:32 +08:00
python3 ./build.py --flutter --skip-cargo
2024-05-02 14:23:59 +08:00
for name in rustdesk*??.deb; do
mv "$name" "${name%%.deb}-${{ matrix.job.arch }}.deb"
done
2024-05-02 14:57:17 +08:00
2024-05-02 13:23:32 +08:00
# rpm package
echo -e "start packaging fedora package"
pushd /workspace
case ${{ matrix.job.arch }} in
aarch64)
sed -i "s/linux\/x64/linux\/arm64/g" ./res/rpm-flutter.spec
;;
esac
HBB=`pwd` rpmbuild ./res/rpm-flutter.spec -bb
pushd ~/rpmbuild/RPMS/${{ matrix.job.arch }}
2024-05-02 14:57:17 +08:00
for name in rustdesk*??.rpm; do
mv "$name" /workspace/"${name%%.rpm}.rpm"
done
2024-05-02 13:23:32 +08:00
# rpm suse package
echo -e "start packaging suse package"
pushd /workspace
case ${{ matrix.job.arch }} in
aarch64)
sed -i "s/linux\/x64/linux\/arm64/g" ./res/rpm-flutter-suse.spec
;;
esac
HBB=`pwd` rpmbuild ./res/rpm-flutter-suse.spec -bb
pushd ~/rpmbuild/RPMS/${{ matrix.job.arch }}
for name in rustdesk*??.rpm; do
2024-05-02 14:57:17 +08:00
mv "$name" /workspace/"${name%%.rpm}-suse.rpm"
2024-05-02 13:23:32 +08:00
done
- name : Publish debian/rpm package
if : env.UPLOAD_ARTIFACT == 'true'
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
rustdesk-*.deb
rustdesk-*.rpm
2024-08-01 09:12:11 +08:00
- name : Upload deb
2023-04-02 22:41:16 +08:00
uses : actions/upload-artifact@master
2024-05-02 13:36:01 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
with :
2024-05-02 13:23:32 +08:00
name : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb
path : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb
2024-08-01 09:12:11 +08:00
2024-05-02 18:14:42 +08:00
# only x86_64 for arch since we can not find newest arm64 docker image to build
# old arch image does not make sense for arch since it is "arch" which always update to date
2024-08-01 09:12:11 +08:00
# and failed to makepkg arm64 on x86_64
2024-05-02 18:14:42 +08:00
- name : Patch archlinux PKGBUILD
if : matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true'
run : |
sed -i "s/x86_64/${{ matrix.job.arch }}/g" res/PKGBUILD
if [[ "${{ matrix.job.arch }}" == "aarch64" ]]; then
2024-05-08 18:09:29 +08:00
sed -i "s/x86_64/aarch64/g" ./res/PKGBUILD
2024-05-02 18:14:42 +08:00
fi
- name : Build archlinux package
if : matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true'
uses : rustdesk-org/arch-makepkg-action@master
with :
2024-05-08 21:29:33 +08:00
packages :
2024-05-02 18:14:42 +08:00
scripts : |
cd res && HBB=`pwd`/.. FLUTTER=1 makepkg -f
- name : Publish archlinux package
if : matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true'
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
res/rustdesk-${{ env.VERSION }}*.zst
2024-07-01 11:01:35 +08:00
build-rustdesk-linux-sciter :
2023-07-12 16:07:55 +08:00
if : ${{ inputs.upload-artifact }}
2024-05-02 13:23:32 +08:00
needs : build-rustdesk-linux # not for dep, just make it run later for parallelism
2024-07-01 11:01:35 +08:00
runs-on : ${{ matrix.job.on }}
name : build-rustdesk-linux-sciter ${{ matrix.job.target }}
2023-04-02 22:41:16 +08:00
strategy :
fail-fast : false
matrix :
# use a high level qemu-user-static
job :
2024-07-01 11:01:35 +08:00
- {
arch : x86_64,
target : x86_64-unknown-linux-gnu,
on : ubuntu-20.04,
distro : ubuntu18.04,
deb_arch : amd64,
sciter_arch : x64,
2024-07-03 17:57:58 +08:00
vcpkg-triplet : x64-linux,
2024-07-23 23:31:36 +08:00
extra_features : ",hwcodec" ,
2024-07-01 11:01:35 +08:00
}
2023-04-02 22:41:16 +08:00
- {
arch : armv7,
target : armv7-unknown-linux-gnueabihf,
2024-07-01 11:01:35 +08:00
on : [ self-hosted, Linux, ARM64],
distro : ubuntu18.04-rustdesk,
deb_arch : armhf,
sciter_arch : arm32,
2024-07-03 17:57:58 +08:00
vcpkg-triplet : arm-linux,
2024-07-23 23:31:36 +08:00
extra_features : "" ,
2023-04-02 22:41:16 +08:00
}
steps :
2023-11-04 03:41:48 +08:00
- name : Export GitHub Actions cache environment variables
uses : actions/github-script@v6
with :
script : |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2023-04-02 22:41:16 +08:00
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
- name : Free Space
run : |
2023-08-19 17:41:28 +08:00
df -h
free -m
2023-04-02 22:41:16 +08:00
- name : Install Rust toolchain
2023-11-23 05:09:56 +08:00
uses : dtolnay/rust-toolchain@v1
2023-04-02 22:41:16 +08:00
with :
2024-07-27 16:16:31 +08:00
toolchain : ${{ env.SCITER_RUST_VERSION }}
2023-11-23 05:09:56 +08:00
targets : ${{ matrix.job.target }}
2024-03-27 01:48:34 +08:00
components : "rustfmt"
2023-11-04 03:41:48 +08:00
2023-07-17 07:52:18 +08:00
- name : Save Rust toolchain version
run : |
RUST_TOOLCHAIN_VERSION=$(cargo --version | awk '{print $2}')
echo "RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION" >> $GITHUB_ENV
2023-04-02 22:41:16 +08:00
2023-06-24 02:59:50 +08:00
- uses : rustdesk-org/run-on-arch-action@amd64-support
2023-04-02 22:41:16 +08:00
name : Build rustdesk sciter binary for ${{ matrix.job.arch }}
id : vcpkg
with :
arch : ${{ matrix.job.arch }}
2024-07-01 11:01:35 +08:00
distro : ${{ matrix.job.distro }}
2023-04-02 22:41:16 +08:00
githubToken : ${{ github.token }}
setup : |
ls -l "${PWD}"
dockerRunArgs : |
--volume "${PWD}:/workspace"
shell : /bin/bash
install : |
2024-07-23 23:31:36 +08:00
apt-get update
2023-11-04 03:41:48 +08:00
apt-get install -y \
build-essential \
clang \
curl \
gcc \
git \
g++ \
2024-09-15 14:33:59 +08:00
libayatana-appindicator3-dev \
2023-11-04 03:41:48 +08:00
libasound2-dev \
libclang-dev \
libdbus-1-dev \
libglib2.0-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
liblzma-dev \
libpam0g-dev \
libpulse-dev \
libva-dev \
libvdpau-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxdo-dev \
libxfixes-dev \
ninja-build \
pkg-config \
python3 \
2024-07-23 23:31:36 +08:00
python3.7 \
2023-11-04 03:41:48 +08:00
rpm \
unzip \
wget \
2024-07-24 10:16:25 +08:00
xz-utils \
zip
2024-07-27 21:28:34 +08:00
# arm-linux needs CMake and vcokg built from source as there
# are no prebuilts available from Kitware and Microsoft
2024-07-27 15:32:26 +08:00
if [ "${{ matrix.job.vcpkg-triplet }}" = "arm-linux" ]; then
2024-07-27 21:28:34 +08:00
# install gcc/g++ 8 for vcpkg and OpenSSL headers for CMake
apt-get install -y gcc-8 g++-8 libssl-dev
# bootstrap CMake amd add it to PATH
2024-07-27 15:32:26 +08:00
git clone --depth 1 https://github.com/kitware/cmake -b "v${{ env.SCITER_ARMV7_CMAKE_VERSION }}" /tmp/cmake
pushd /tmp/cmake
2024-07-27 16:29:53 +08:00
./bootstrap --generator='Unix Makefiles' "--prefix=/opt/cmake-${{ env.SCITER_ARMV7_CMAKE_VERSION }}-linux-armhf"
make -j1 install
2024-07-27 15:32:26 +08:00
popd
rm -rf /tmp/cmake
export PATH="/opt/cmake-${{ env.SCITER_ARMV7_CMAKE_VERSION }}-linux-armhf/bin:$PATH"
fi
2024-07-27 21:28:34 +08:00
# bootstrap vcpkg and set VCPKG_ROOT
2024-07-23 23:31:36 +08:00
export VCPKG_ROOT=/opt/artifacts/vcpkg
2024-07-27 23:57:53 +08:00
mkdir -p /opt/artifacts
2024-07-24 10:16:25 +08:00
pushd /opt/artifacts
2024-07-24 11:23:49 +08:00
rm -rf vcpkg
2024-07-24 10:16:25 +08:00
git clone https://github.com/microsoft/vcpkg
pushd vcpkg
git reset --hard ${{ env.VCPKG_COMMIT_ID }}
2024-07-27 21:28:34 +08:00
# build vcpkg helper executable with gcc-8 for arm-linux but use prebuilt one on x64-linux
2024-07-27 15:32:26 +08:00
if [ "${{ matrix.job.vcpkg-triplet }}" = "arm-linux" ]; then
CC=/usr/bin/gcc-8 CXX=/usr/bin/g++-8 sh bootstrap-vcpkg.sh -disableMetrics
else
sh bootstrap-vcpkg.sh -disableMetrics
fi
2024-07-24 10:16:25 +08:00
popd
popd
2023-04-02 22:41:16 +08:00
# rust
pushd /opt
2023-05-12 11:20:22 +08:00
# do not use rustup, because memory overflow in qemu
2024-07-27 21:28:34 +08:00
wget --output-document rust.tar.gz https://static.rust-lang.org/dist/rust-${{env.RUST_TOOLCHAIN_VERSION}}-${{ matrix.job.target }}.tar.gz
2023-04-02 22:41:16 +08:00
tar -zxvf rust.tar.gz > /dev/null && rm rust.tar.gz
2024-07-27 21:28:34 +08:00
pushd rust-${{env.RUST_TOOLCHAIN_VERSION}}-${{ matrix.job.target }}
./install.sh
popd
2023-07-17 07:52:18 +08:00
rm -rf rust-${{env.RUST_TOOLCHAIN_VERSION}}-${{ matrix.job.target }}
2024-07-27 21:28:34 +08:00
popd
# install newer nasm for aom
wget --output-document nasm.deb "http://ftp.us.debian.org/debian/pool/main/n/nasm/nasm_${{ env.SCITER_NASM_DEBVERSION }}_${{ matrix.job.deb_arch }}.deb"
dpkg -i nasm.deb
rm -f nasm.deb
run : |
# disable git safe.directory
git config --global --add safe.directory "*"
# set python3.7 as default python3
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
2024-07-28 08:44:16 +08:00
# add built CMake to PATH and set VCPKG_FORCE_SYSTEM_BINARIES Afor arm-linux
2024-07-27 21:28:34 +08:00
if [ "${{ matrix.job.vcpkg-triplet }}" = "arm-linux" ]; then
export PATH="/opt/cmake-${{ env.SCITER_ARMV7_CMAKE_VERSION }}-linux-armhf/bin:$PATH"
2024-07-28 08:44:16 +08:00
export VCPKG_FORCE_SYSTEM_BINARIES=1
2024-07-27 21:28:34 +08:00
fi
# edit cargo config
2023-04-02 22:41:16 +08:00
mkdir -p ~/.cargo/
echo """
[ source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
"" " > ~/.cargo/config
cat ~/.cargo/config
2024-07-27 21:28:34 +08:00
# install dependencies from vcpkg
export VCPKG_ROOT=/opt/artifacts/vcpkg
2024-08-02 18:43:30 +08:00
if ! $VCPKG_ROOT/vcpkg install --triplet ${{ matrix.job.vcpkg-triplet }} --x-install-root="$VCPKG_ROOT/installed"; then
find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do
echo "$_1:"
echo "======"
cat "$_1"
echo "======"
echo ""
done
exit 1
fi
2024-07-27 21:28:34 +08:00
# build rustdesk
2023-04-02 22:41:16 +08:00
python3 ./res/inline-sciter.py
2023-08-18 12:09:52 +08:00
export CARGO_INCREMENTAL=0
2024-07-23 23:31:36 +08:00
cargo build --features inline${{ matrix.job.extra_features }} --release --bins --jobs 1
2024-07-27 21:28:34 +08:00
# make debian package
2023-04-02 22:41:16 +08:00
mkdir -p ./Release
mv ./target/release/rustdesk ./Release/rustdesk
2024-07-01 11:01:35 +08:00
wget -O ./Release/libsciter-gtk.so https://github.com/c-smile/sciter-sdk/raw/master/bin.lnx/${{ matrix.job.sciter_arch }}/libsciter-gtk.so
export DEB_ARCH=${{ matrix.job.deb_arch }}
2023-04-02 22:41:16 +08:00
./build.py --package ./Release
- name : Rename rustdesk
shell : bash
run : |
for name in rustdesk*??.deb; do
# use cp to duplicate deb files to fit other packages.
2023-04-06 09:31:36 +08:00
cp "$name" "${name%%.deb}-${{ matrix.job.arch }}-sciter.deb"
2023-04-02 22:41:16 +08:00
done
- name : Publish debian package
2024-05-02 13:36:01 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2023-04-02 22:41:16 +08:00
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
2023-04-03 20:35:09 +08:00
rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}-sciter.deb
2023-04-02 22:41:16 +08:00
2024-08-01 09:12:11 +08:00
- name : Upload deb
2024-07-01 11:01:35 +08:00
uses : actions/upload-artifact@master
if : env.UPLOAD_ARTIFACT == 'true'
with :
name : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}-sciter.deb
path : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}-sciter.deb
2024-05-02 18:14:42 +08:00
build-appimage :
name : Build appimage ${{ matrix.job.target }}
2024-05-02 13:23:32 +08:00
needs : [ build-rustdesk-linux]
2024-05-02 17:03:20 +08:00
runs-on : ubuntu-20.04
2024-05-02 13:23:32 +08:00
if : ${{ inputs.upload-artifact }}
2023-04-02 22:41:16 +08:00
strategy :
fail-fast : false
matrix :
job :
2024-08-01 09:12:11 +08:00
- { target: x86_64-unknown-linux-gnu, arch : x86_64 }
- { target: aarch64-unknown-linux-gnu, arch : aarch64 }
2023-04-02 22:41:16 +08:00
steps :
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2023-04-02 22:41:16 +08:00
2024-05-02 13:23:32 +08:00
- name : Download Binary
2023-04-02 22:41:16 +08:00
uses : actions/download-artifact@master
with :
2023-04-03 20:35:09 +08:00
name : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb
2024-05-02 13:23:32 +08:00
path : .
2023-04-02 22:41:16 +08:00
2024-05-02 13:23:32 +08:00
- name : Rename Binary
2023-04-02 22:41:16 +08:00
run : |
2024-05-08 20:07:57 +08:00
mv rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb appimage/rustdesk.deb
2023-04-02 22:41:16 +08:00
- name : Build appimage package
shell : bash
run : |
2024-05-02 19:32:53 +08:00
# install libarchive-tools for bsdtar command used in AppImageBuilder.yml
sudo apt-get update -y
sudo apt-get install -y libarchive-tools
2023-04-02 22:41:16 +08:00
# set-up appimage-builder
pushd /tmp
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
popd
# run appimage-builder
pushd appimage
2024-04-30 09:08:08 +08:00
sudo appimage-builder --skip-tests --recipe ./AppImageBuilder-${{ matrix.job.arch }}.yml
2023-04-02 22:41:16 +08:00
2024-05-02 18:14:42 +08:00
- name : Publish appimage package
2024-05-03 03:12:47 +08:00
if : env.UPLOAD_ARTIFACT == 'true'
2024-05-02 18:14:42 +08:00
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
./appimage/rustdesk-${{ env.VERSION }}-*.AppImage
2024-05-02 17:03:20 +08:00
build-flatpak :
2024-07-01 11:01:35 +08:00
name : Build flatpak ${{ matrix.job.target }}${{ matrix.job.suffix }}
2024-08-01 09:12:11 +08:00
needs :
2024-07-01 11:01:35 +08:00
- build-rustdesk-linux
- build-rustdesk-linux-sciter
2024-05-02 17:03:20 +08:00
runs-on : ${{ matrix.job.on }}
if : ${{ inputs.upload-artifact }}
strategy :
fail-fast : false
matrix :
job :
- {
target : x86_64-unknown-linux-gnu,
distro : ubuntu18.04,
on : ubuntu-20.04,
arch : x86_64,
2024-07-01 11:01:35 +08:00
suffix : "" ,
}
- {
target : x86_64-unknown-linux-gnu,
distro : ubuntu18.04,
on : ubuntu-20.04,
arch : x86_64,
suffix : "-sciter" ,
2024-05-02 17:03:20 +08:00
}
- {
target : aarch64-unknown-linux-gnu,
# try out newer flatpak since error of "error: Nothing matches org.freedesktop.Platform in remote flathub"
distro : ubuntu22.04,
on : [ self-hosted, Linux, ARM64],
arch : aarch64,
2024-07-01 11:01:35 +08:00
suffix : "" ,
2024-05-02 17:03:20 +08:00
}
steps :
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2024-05-02 17:03:20 +08:00
- name : Download Binary
uses : actions/download-artifact@master
with :
2024-07-01 11:01:35 +08:00
name : rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.deb
2024-05-02 17:03:20 +08:00
path : .
- name : Rename Binary
run : |
2024-07-01 11:01:35 +08:00
mv rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.deb flatpak/rustdesk.deb
2024-05-02 17:03:20 +08:00
2023-06-24 02:59:50 +08:00
- uses : rustdesk-org/run-on-arch-action@amd64-support
2023-04-02 22:41:16 +08:00
name : Build rustdesk flatpak package for ${{ matrix.job.arch }}
2024-05-08 20:07:57 +08:00
id : flatpak
2023-04-02 22:41:16 +08:00
with :
arch : ${{ matrix.job.arch }}
2024-04-30 09:08:08 +08:00
distro : ${{ matrix.job.distro }}
2023-04-02 22:41:16 +08:00
githubToken : ${{ github.token }}
setup : |
ls -l "${PWD}"
dockerRunArgs : |
--volume "${PWD}:/workspace"
shell : /bin/bash
install : |
2023-11-04 03:41:48 +08:00
apt-get update -y
apt-get install -y \
curl \
git \
rpm \
wget
2023-04-02 22:41:16 +08:00
run : |
# disable git safe.directory
git config --global --add safe.directory "*"
pushd /workspace
2024-08-01 09:12:11 +08:00
# install
2023-11-04 03:41:48 +08:00
apt-get update -y
apt-get install -y \
cmake \
curl \
flatpak \
flatpak-builder \
gcc \
git \
g++ \
libgtk-3-dev \
nasm \
2023-11-15 22:03:40 +08:00
wget
2023-04-02 22:41:16 +08:00
# flatpak deps
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
2024-10-07 21:50:01 +08:00
flatpak --user install -y flathub org.freedesktop.Platform/${{ matrix.job.arch }}/23.08
flatpak --user install -y flathub org.freedesktop.Sdk/${{ matrix.job.arch }}/23.08
2023-04-02 22:41:16 +08:00
# package
pushd flatpak
git clone https://github.com/flathub/shared-modules.git --depth=1
flatpak-builder --user --force-clean --repo=repo ./build ./rustdesk.json
2024-07-01 11:01:35 +08:00
flatpak build-bundle ./repo rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.flatpak com.rustdesk.RustDesk
2023-04-02 22:41:16 +08:00
- name : Publish flatpak package
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
2024-07-01 11:01:35 +08:00
flatpak/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.flatpak
2024-03-23 14:28:25 +08:00
build-rustdesk-web :
2024-06-22 12:29:20 +08:00
if : False
2024-03-23 14:28:25 +08:00
name : build-rustdesk-web
runs-on : ubuntu-20.04
strategy :
fail-fast : false
env :
RELEASE_NAME : web-basic
steps :
- name : Checkout source code
2024-08-01 09:12:11 +08:00
uses : actions/checkout@v4
2024-03-23 14:28:25 +08:00
- name : Prepare env
run : |
sudo apt-get update -y
sudo apt-get install -y wget npm
2024-03-25 11:21:01 +08:00
2024-03-23 14:28:25 +08:00
- name : Install flutter
uses : subosito/flutter-action@v2.12.0 #https://github.com/subosito/flutter-action/issues/277
with :
channel : "stable"
flutter-version : ${{ env.FLUTTER_VERSION }}
cache : true
# https://rustdesk.com/docs/en/dev/build/web/
- name : Build web
shell : bash
run : |
pushd flutter/web/js
npm install yarn -g
npm install typescript -g
npm install protoc -g
# Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html
npm install ts-proto
# Only works with vite <= 2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy
npm install vite@2.8
yarn install && yarn build
popd
pushd flutter/web
wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/web_deps.tar.gz
tar xzf web_deps.tar.gz
popd
pushd flutter
flutter build web --release
cd build
cp ../web/README.md web
# TODO: Remove the following line when the web is almost complete.
echo -e "\n\nThis build is for preview and not full functionality." >> web/README.md
dir_name="rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}"
mv web "${dir_name}" && tar czf "${dir_name}".tar.gz "${dir_name}"
sha256sum "${dir_name}".tar.gz
popd
- name : Publish web
if : env.UPLOAD_ARTIFACT == 'true'
uses : softprops/action-gh-release@v1
with :
prerelease : true
tag_name : ${{ env.TAG_NAME }}
files : |
flutter/build/rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}.tar.gz