name: Build the flutter version of the RustDesk on: workflow_dispatch: inputs: upload-artifact: type: boolean default: true upload-tag: type: string default: "nightly" env: CARGO_NDK_VERSION: "3.1.2" LLVM_VERSION: "15.0.6" FLUTTER_VERSION: "3.10.6" FLUTTER_RUST_BRIDGE_VERSION: "1.75.3" # for arm64 linux FLUTTER_ELINUX_VERSION: "3.10.6" FLUTTER_ELINUX_COMMIT_ID: "410b3ca42f2cd0c485edf517a1666652bab442d4" TAG_NAME: "${{ inputs.upload-tag }}" # vcpkg version: 2023.04.15 # for multiarch gcc compatibility VCPKG_COMMIT_ID: "501db0f17ef6df184fcdbfbe0f87cde2313b6ab1" VERSION: "1.2.3" NDK_VERSION: "r25c" #signing keys env variable checks ANDROID_SIGNING_KEY: '${{ secrets.ANDROID_SIGNING_KEY }}' MACOS_P12_BASE64: '${{ secrets.MACOS_P12_BASE64 }}' # To make a custom build with your own servers set the below secret values RS_PUB_KEY: '${{ secrets.RS_PUB_KEY }}' RENDEZVOUS_SERVER: '${{ secrets.RENDEZVOUS_SERVER }}' UPLOAD_ARTIFACT: "${{ inputs.upload-artifact }}" jobs: build-for-windows-flutter: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) runs-on: [self-hosted, Windows] strategy: fail-fast: false matrix: job: - { target: x86_64-pc-windows-msvc, os: windows-2019, arch: x86_64 } steps: - name: Checkout source code uses: actions/checkout@v3 # - name: Install LLVM and Clang # uses: KyleMayes/install-llvm-action@v1 # with: # version: ${{ env.LLVM_VERSION }} # - name: Install flutter # uses: subosito/flutter-action@v2 # with: # channel: "stable" # flutter-version: ${{ env.FLUTTER_VERSION }} # cache: true # - name: Replace engine with rustdesk custom flutter engine # run: | # flutter doctor -v # flutter precache --windows # Invoke-WebRequest -Uri https://github.com/Kingtous/engine/releases/download/v3.7.0-rustdesk/windows-x64-release-flutter.zip -OutFile windows-x64-flutter-release.zip # Expand-Archive windows-x64-flutter-release.zip -DestinationPath engine # mv -Force engine/* C:/hostedtoolcache/windows/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/bin/cache/artifacts/engine/windows-x64-release/ - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable target: ${{ matrix.job.target }} override: true profile: minimal # minimal component installation (ie, no documentation) - uses: Swatinem/rust-cache@v2 with: prefix-key: ${{ matrix.job.os }} - name: Install flutter rust bridge deps run: | git config --global core.longpaths true cargo install flutter_rust_bridge_codegen --version ${{ env.FLUTTER_RUST_BRIDGE_VERSION }} --features "uuid" Push-Location flutter ; flutter pub get ; Pop-Location ~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart # - name: Install vcpkg dependencies # run: | # cd C:\ # git clone https://github.com/Kingtous/rustdesk_thirdpary_lib --depth=1 - name: Build rustdesk env: VCPKG_ROOT: C:\rustdesk_thirdpary_lib\vcpkg run: python .\build.py --portable --hwcodec --flutter --feature IddDriver - 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: | runner_res=$(find . -name "Runner.res"); if [ "$runner_res" == "" ]; then echo "Runner.res: not found"; else echo "Runner.res: $runner_res"; cp $runner_res ./libs/portable/Runner.res; echo "list ./libs/portable/Runner.res"; ls -l ./libs/portable/Runner.res; fi - name: Sign rustdesk files uses: GermanBluefox/code-sign-action@v7 if: env.UPLOAD_ARTIFACT == 'true' with: certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' # certificatename: '${{ secrets.CERTNAME }}' folder: './flutter/build/windows/runner/Release/' recursive: true - name: Build self-extracted executable shell: bash if: env.UPLOAD_ARTIFACT == 'true' run: | pushd ./libs/portable python ./generate.py -f ../../flutter/build/windows/runner/Release/ -o . -e ../../flutter/build/windows/runner/Release/rustdesk.exe popd mkdir -p ./SignOutput mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.exe - name: Sign rustdesk self-extracted file uses: GermanBluefox/code-sign-action@v7 if: env.UPLOAD_ARTIFACT == 'true' with: certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' # certificatename: '${{ secrets.WINDOWS_PFX_NAME }}' folder: './SignOutput' recursive: false - name: Publish Release uses: softprops/action-gh-release@v1 if: env.UPLOAD_ARTIFACT == 'true' with: prerelease: true tag_name: ${{ env.TAG_NAME }} files: | ./SignOutput/rustdesk-*.exe