前端: - 「我的构建」列表「查看详情/查看进度」按钮补充与其他按钮同风格的眼睛小图标 - 顶部导航增加 768px 以下移动端适配: 顶栏纵向排列, 导航单行横向滑动, 修复手机端错位 Gitea Actions 工作流 (仅 .gitea, 不动 .github): - 5 个生成器工作流全部补充 /updategh 终态状态回调 (成功/取消/失败均回调), 修复无回调导致构建 6 小时后被误判为超时的 P0 缺陷 - Windows 两个工作流 job 级默认 shell 设为 pwsh, 兼容 act 在 Windows 默认 bash - 修复 VCPKG_BINARY_SOURCES 中 \v 的 YAML 非法转义 (双引号改单引号) - Flutter 补丁路径改为 .rdgen-src/.github/patches/, run-on-arch 容器内用 /workspace 前缀 - run-on-arch githubToken 置空, 避免 Gitea token 拉 ghcr.io 失败 - runs-on 标签对齐现场 runner: ubuntu-22.04 改为 ubuntu-24.04 - run-vcpkg/setup-ndk 钉到 node20 运行时 SHA, 规避 node24 action 不兼容 - decrypt-secrets 的 pip 安装增加三级回退; cleanzip 请求增加超时重试 - 所有产物上传 curl 增加 --fail/超时/重试参数 - macOS 动态定位 *.app 不再硬编码 RustDesk.app, DMG 路径改用 GITHUB_WORKSPACE - 修复签名条件判断、PowerShell 变量空格等小问题 - setup.md 更新 runner 标签表及 Windows/macOS host 准备要求
828 lines
40 KiB
YAML
828 lines
40 KiB
YAML
# Gitea Actions 适配副本:由 .github/workflows 同名文件适配(本地路径/cache/artifact 差异),修改时请同步两边。差异说明见 setup.md「Gitea 部署附录」。
|
|
name: Custom macOS Client Generator
|
|
run-name: Custom macOS Client Generator
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'version to buld'
|
|
required: true
|
|
default: ''
|
|
type: string
|
|
zip_url:
|
|
description: 'url to zip of json'
|
|
required: true
|
|
default: ''
|
|
type: string
|
|
|
|
env:
|
|
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
|
|
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
|
|
MAC_RUST_VERSION: "1.81"
|
|
CARGO_NDK_VERSION: "3.1.2"
|
|
SCITER_ARMV7_CMAKE_VERSION: "3.29.7"
|
|
SCITER_NASM_DEBVERSION: "2.14-1"
|
|
LLVM_VERSION: "15.0.6"
|
|
FLUTTER_VERSION: "3.24.5"
|
|
ANDROID_FLUTTER_VERSION: "3.24.5" # >= 3.16 is very slow on my android phone, but work well on most of others. We may switch to new flutter after changing to texture rendering (I believe it can solve my problem).
|
|
FLUTTER_RUST_BRIDGE_VERSION: "1.80.1" # for arm64 linux because official Dart SDK does not work
|
|
FLUTTER_ELINUX_VERSION: "3.16.9"
|
|
TAG_NAME: "${{ inputs.upload-tag }}"
|
|
VCPKG_BINARY_SOURCES: "clear;files,/Users/runner/vcpkg-cache,readwrite"
|
|
# vcpkg version: 2024.07.12
|
|
VCPKG_COMMIT_ID: "${{ inputs.version == 'master' && '9e593bb18ea69cc5095e012465dcd675a822ed0d' || '120deac3062162151622ca4860575a33844ba10b' }}"
|
|
ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836"
|
|
VERSION: "${{ inputs.version }}"
|
|
NDK_VERSION: "r28c"
|
|
#signing keys env variable checks
|
|
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
|
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
|
UPLOAD_ARTIFACT: 'true'
|
|
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
|
|
|
jobs:
|
|
setup:
|
|
uses: ./.gitea/workflows/fetch-encrypted-secrets.yml
|
|
with:
|
|
zip_url_json: ${{ inputs.zip_url }}
|
|
|
|
generate-bridge:
|
|
uses: ./.gitea/workflows/bridge.yml
|
|
with:
|
|
version: ${{ inputs.version }}
|
|
|
|
build-for-macos:
|
|
name: ${{ matrix.job.target }}
|
|
runs-on: ${{ matrix.job.os }}
|
|
needs: [generate-bridge, setup]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
job:
|
|
- {
|
|
target: x86_64-apple-darwin,
|
|
os: macos-15-intel, #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
|
|
extra-build-args: "",
|
|
arch: x86_64,
|
|
vcpkg-triplet: x64-osx,
|
|
}
|
|
- {
|
|
target: aarch64-apple-darwin,
|
|
os: macos-14,
|
|
# 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: "--screencapturekit",
|
|
arch: aarch64,
|
|
vcpkg-triplet: arm64-osx,
|
|
}
|
|
env:
|
|
STATUS_URL: "${{ secrets.GENURL }}/updategh"
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: .rdgen-src
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: encrypted-secrets-zip
|
|
|
|
- name: Load Secrets
|
|
uses: ./.gitea/actions/decrypt-secrets
|
|
with:
|
|
zip_password: ${{ secrets.ZIP_PASSWORD }}
|
|
|
|
- name: Finalize and Cleanup zip/json
|
|
if: always() # Run even if previous steps fail
|
|
continue-on-error: true
|
|
uses: fjogeleit/http-request-action@v1
|
|
with:
|
|
url: "${{ secrets.GENURL }}/cleanzip"
|
|
method: 'POST'
|
|
customHeaders: '{"Content-Type": "application/json"}'
|
|
data: '{"uuid": "${{ env.uuid }}"}'
|
|
timeout: '15000'
|
|
retry: '3'
|
|
|
|
|
|
- name: Checkout source code
|
|
if: ${{ env.VERSION != 'master' }}
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: rustdesk/rustdesk
|
|
ref: refs/tags/${{ env.VERSION }}
|
|
submodules: recursive
|
|
|
|
- name: Checkout source code
|
|
if: ${{ env.VERSION == 'master' }}
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: rustdesk/rustdesk
|
|
submodules: recursive
|
|
|
|
- name: Install imagemagick and potrace and nasm and and
|
|
shell: bash
|
|
run: |
|
|
brew install imagemagick potrace nasm cmake gcc wget ninja
|
|
echo "$(brew --prefix imagemagick)/bin" >> $GITHUB_PATH
|
|
|
|
- name: Update macOS Info.plist and settings
|
|
continue-on-error: false
|
|
shell: bash
|
|
run: |
|
|
# MACSTUFF Update Info.plist
|
|
sed -i '' -e 's|<key>CFBundleName</key>.*<string>.*</string>|<key>CFBundleName</key>\n\t<string>${{ env.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
|
sed -i '' -e 's|<key>CFBundleDisplayName</key>.*<string>.*</string>|<key>CFBundleDisplayName</key>\n\t<string>${{ env.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
|
sed -i '' -e 's|<key>CFBundleIdentifier</key>.*<string>.*</string>|<key>CFBundleIdentifier</key>\n\t<string>com.${{ env.appname }}.app</string>|' ./flutter/macos/Runner/Info.plist
|
|
|
|
# MACSTUFF Update AppInfo.xcconfig
|
|
sed -i '' -e 's|PRODUCT_NAME = .*|PRODUCT_NAME = ${{ env.appname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
|
sed -i '' -e 's|PRODUCT_BUNDLE_IDENTIFIER = .*|PRODUCT_BUNDLE_IDENTIFIER = com.${{ env.appname }}.app|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
|
sed -i '' -e 's|Purslane Tech Pte. Ltd.|${{ env.compname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
|
sed -i '' -e 's|Purslane Ltd.|${{ env.compname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
|
|
|
sed -i -e 's|Purslane Tech Pte. Ltd.|${{ env.compname }}|' ./Cargo.toml
|
|
sed -i -e 's|Purslane Tech Pte. Ltd.|${{ env.compname }}|' ./libs/portable/Cargo.toml
|
|
sed -i -e 's|Purslane Tech Pte. Ltd.|${{ env.compname }}|' ./flutter/lib/desktop/pages/desktop_setting_page.dart
|
|
sed -i -e 's|Purslane Tech Pte. Ltd.|${{ env.compname }}|' ./src/main.rs
|
|
sed -i -e 's|Purslane Ltd.|${{ env.compname }}|' ./Cargo.toml
|
|
sed -i -e 's|Purslane Ltd.|${{ env.compname }}|' ./libs/portable/Cargo.toml
|
|
sed -i -e 's|Purslane Ltd.|${{ env.compname }}|' ./flutter/lib/desktop/pages/desktop_setting_page.dart
|
|
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./src/main.rs
|
|
|
|
# Update Xcode project settings
|
|
sed -i '' -e 's/PRODUCT_NAME = "RustDesk"/PRODUCT_NAME = "${{ env.appname }}"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj
|
|
sed -i '' -e 's/PRODUCT_BUNDLE_IDENTIFIER = ".*"/PRODUCT_BUNDLE_IDENTIFIER = "com.${{ env.appname }}.app"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj
|
|
|
|
# Update CMake settings
|
|
if [ -f "./flutter/macos/CMakeLists.txt" ]; then
|
|
sed -i '' -e 's/set(BINARY_NAME ".*")/set(BINARY_NAME "${{ env.appname }}")/' ./flutter/macos/CMakeLists.txt
|
|
fi
|
|
|
|
# Update Podfile - keep the target as 'Runner'
|
|
sed -i '' -e 's/target '"'"'Runner'"'"' do/target '"'"'Runner'"'"' do/' ./flutter/macos/Podfile
|
|
|
|
find ./src/lang -name "*.rs" -exec sed -i '' -e 's|RustDesk|${{ env.appname }}|' {} \;
|
|
sed -i '' -e 's|RustDesk|${{ env.appname }}|' ./src/lang/nl.rs
|
|
|
|
sed -i '' -e 's|https://rustdesk.com|${{ env.urlLink }}|' ./build.py
|
|
sed -i '' -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ env.urlLink }}'));|" ./flutter/lib/common.dart
|
|
sed -i '' -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ env.urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
|
|
sed -i '' -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
|
|
sed -i '' -e "s|const url = 'https://rustdesk.com/';|const url = '${{ env.urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
|
|
sed -i '' -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
|
sed -i '' -e "s|https://rustdesk.com/privacy.html|${{ env.urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
|
|
|
- name: change download link to custom
|
|
if: env.downloadLink != 'https://rustdesk.com/download'
|
|
continue-on-error: true
|
|
shell: bash
|
|
run: |
|
|
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
|
|
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
|
|
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./src/ui/index.tis
|
|
sed -i -e 's|&download_url|"${{ env.downloadLink }}"|' ./src/updater.rs
|
|
sed -i -e 's|$downloadUrl/$downloadFile|${{ env.downloadLink }}|' ./flutter/lib/desktop/widgets/update_progress.dart
|
|
|
|
# Update slogan - About in en.rs
|
|
sed -i '' -e 's/("Slogan_tip", "Made with heart in this chaotic world!")/("Slogan_tip", "Powered by ${{ env.appname }}")/' ./src/lang/en.rs
|
|
sed -i '' -e 's/("About RustDesk", "")/("About RustDesk", "About ${{ env.appname }}")/' ./src/lang/en.rs
|
|
|
|
|
|
# Update slogan - About in nl.rs
|
|
sed -i '' -e 's/("Slogan_tip", "Ontwikkeld met het hart voor deze chaotische wereld!")/("Slogan_tip", "Powered by ${{ env.appname }}")/' ./src/lang/nl.rs
|
|
sed -i '' -e 's/("Your Desktop", "Uw Bureaublad")/("Your Desktop", "Uw ${{ env.appname }}")/' ./src/lang/nl.rs
|
|
sed -i '' -e 's/("About RustDesk", "Over RustDesk")/("About RustDesk", "Over ${{ env.appname }}")/' ./src/lang/nl.rs
|
|
sed -i '' -e 's/("About", "Over")/("About", "Over ${{ env.appname }}")/' ./src/lang/nl.rs
|
|
|
|
# Update pubspec.yaml with proper YAML formatting
|
|
cp ./flutter/pubspec.yaml ./flutter/pubspec.yaml.bak
|
|
echo " archive: ^3.6.1" > ./flutter/temp_dependency.txt
|
|
awk '/intl:/{print;system("cat ./flutter/temp_dependency.txt");next}1' ./flutter/pubspec.yaml > ./flutter/pubspec.yaml.tmp
|
|
mv ./flutter/pubspec.yaml.tmp ./flutter/pubspec.yaml
|
|
rm ./flutter/temp_dependency.txt
|
|
|
|
- name: set server, serverPort, key, and apiserver
|
|
continue-on-error: true
|
|
shell: bash
|
|
env:
|
|
SERVER_DOMAIN: ${{ env.server }}
|
|
SERVER_PORT_INPUT: ${{ env.serverPort }}
|
|
SERVER_KEY: ${{ env.key }}
|
|
API_SERVER: ${{ env.apiServer }}
|
|
run: |
|
|
# Pass secrets via bash env vars to avoid quoting issues
|
|
if [ ! -f "./libs/hbb_common/src/config.rs" ]; then
|
|
echo "Error: config.rs not found!"
|
|
exit 1
|
|
fi
|
|
if [ ! -f "./src/common.rs" ]; then
|
|
echo "Error: common.rs not found!"
|
|
exit 1
|
|
fi
|
|
|
|
# Port must be a number; views.py defaults it to 21116
|
|
if ! [[ "$SERVER_PORT_INPUT" =~ ^[0-9]+$ ]]; then
|
|
echo "Error: serverPort must be a number, got: '$SERVER_PORT_INPUT'"
|
|
exit 1
|
|
fi
|
|
|
|
# Derive the port block from the rendezvous port
|
|
# (defaults 21116/21117/21118/21119)
|
|
SERVER_PORT=$SERVER_PORT_INPUT
|
|
RELAY_PORT=$((SERVER_PORT + 1))
|
|
WS_RENDEZVOUS_PORT=$((RELAY_PORT + 1))
|
|
WS_RELAY_PORT=$((WS_RENDEZVOUS_PORT + 1))
|
|
|
|
echo "Setting server: $SERVER_DOMAIN"
|
|
echo "Setting ports: $SERVER_PORT, $RELAY_PORT, $WS_RENDEZVOUS_PORT, $WS_RELAY_PORT"
|
|
|
|
sed -i -e "s|rs-ny.rustdesk.com|$SERVER_DOMAIN|" ./libs/hbb_common/src/config.rs
|
|
|
|
# Match on numeric value so the step is independent of defaults
|
|
sed -i -e "s|pub const RENDEZVOUS_PORT: i32 = [0-9][0-9]*;|pub const RENDEZVOUS_PORT: i32 = $SERVER_PORT;|" ./libs/hbb_common/src/config.rs
|
|
sed -i -e "s|pub const RELAY_PORT: i32 = [0-9][0-9]*;|pub const RELAY_PORT: i32 = $RELAY_PORT;|" ./libs/hbb_common/src/config.rs
|
|
sed -i -e "s|pub const WS_RENDEZVOUS_PORT: i32 = [0-9][0-9]*;|pub const WS_RENDEZVOUS_PORT: i32 = $WS_RENDEZVOUS_PORT;|" ./libs/hbb_common/src/config.rs
|
|
sed -i -e "s|pub const WS_RELAY_PORT: i32 = [0-9][0-9]*;|pub const WS_RELAY_PORT: i32 = $WS_RELAY_PORT;|" ./libs/hbb_common/src/config.rs
|
|
|
|
sed -i -e "s|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|$SERVER_KEY|" ./libs/hbb_common/src/config.rs
|
|
sed -i -e "s|https://admin.rustdesk.com|$API_SERVER|" ./src/common.rs
|
|
|
|
echo "=== Verification ==="
|
|
grep -nE "RENDEZVOUS_PORT|RELAY_PORT|WS_" ./libs/hbb_common/src/config.rs
|
|
|
|
- name: allow custom.txt
|
|
uses: nick-fields/retry@v3
|
|
with:
|
|
timeout_minutes: 5
|
|
max_attempts: 3
|
|
retry_wait_seconds: 15
|
|
shell: bash
|
|
command: |
|
|
cp .rdgen-src/.github/patches/allowCustom.py .
|
|
python allowCustom.py
|
|
cp .rdgen-src/.github/patches/removeSetupServerTip.diff .
|
|
git apply removeSetupServerTip.diff
|
|
# sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml
|
|
|
|
- name: Install build runtime
|
|
run: |
|
|
brew install llvm create-dmg
|
|
# pkg-config is handled in a separate step, because it may be already installed by `macos-latest`(14.7.1) runner
|
|
if command -v pkg-config &>/dev/null; then
|
|
echo "pkg-config is already installed"
|
|
else
|
|
brew install pkg-config
|
|
fi
|
|
|
|
- name: Install NASM
|
|
run: |
|
|
# Install NASM 2.16.x from official release.
|
|
# Do NOT use `brew install nasm` which installs NASM 3.x.
|
|
# NASM 3.x is a complete rewrite with incompatible CLI options and removed features.
|
|
# aom and other multimedia libraries require NASM 2.x for x86/x86_64 assembly.
|
|
wget https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/macosx/nasm-2.16.03-macosx.zip
|
|
unzip nasm-2.16.03-macosx.zip
|
|
sudo cp nasm-2.16.03/nasm /usr/local/bin/nasm
|
|
nasm --version
|
|
|
|
- name: Install flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: "stable"
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
|
|
- name: Patch flutter
|
|
continue-on-error: true
|
|
run: |
|
|
cd $(dirname $(dirname $(which flutter)))
|
|
[[ "3.24.5" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.rdgen-src/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff
|
|
|
|
- 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
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@v1
|
|
with:
|
|
toolchain: ${{ env.MAC_RUST_VERSION }}
|
|
targets: ${{ matrix.job.target }}
|
|
components: "rustfmt"
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
prefix-key: ${{ matrix.job.os }}
|
|
|
|
- name: Magick stuff for macOS
|
|
if: ${{ env.iconlink_url != 'false' }}
|
|
continue-on-error: false
|
|
shell: bash
|
|
run: |
|
|
# Create all necessary directories first
|
|
mkdir -p ./res
|
|
mkdir -p ./flutter/assets
|
|
mkdir -p ./flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset
|
|
mkdir -p ./macos/Runner/Assets.xcassets/AppIcon.appiconset
|
|
mkdir -p ./rustdesk/data/flutter_assets/assets
|
|
|
|
# Download icon using curl with additional SSL options
|
|
curl -k -L --tlsv1.2 --proto =https --ssl-reqd \
|
|
-H "User-Agent: Mozilla/5.0" \
|
|
"${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}&uuid=${{ env.iconlink_uuid }}" \
|
|
-o ./res/icon.png || wget --no-check-certificate -O ./res/icon.png "${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}&uuid=${{ env.iconlink_uuid }}"
|
|
|
|
# Backup existing files (if they exist)
|
|
[ -f "./res/32x32.png" ] && mv ./res/32x32.png ./res/32x32.png.bak
|
|
[ -f "./res/64x64.png" ] && mv ./res/64x64.png ./res/64x64.png.bak
|
|
[ -f "./res/128x128.png" ] && mv ./res/128x128.png ./res/128x128.png.bak
|
|
[ -f "./res/mac-icon.png" ] && mv ./res/mac-icon.png ./res/mac-icon.png.bak
|
|
[ -f "./flutter/assets/icon.png" ] && mv ./flutter/assets/icon.png ./flutter/assets/icon.png.bak
|
|
[ -f "./flutter/assets/icon.svg" ] && mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
|
[ -f "./rustdesk/data/flutter_assets/assets/icon.svg" ] && mv ./rustdesk/data/flutter_assets/assets/icon.svg ./rustdesk/data/flutter_assets/assets/icon.svg.bak
|
|
|
|
# Create standard app icons
|
|
magick ./res/icon.png -resize 32x32 ./res/32x32.png
|
|
magick ./res/icon.png -resize 64x64 ./res/64x64.png
|
|
magick ./res/icon.png -resize 128x128 ./res/128x128.png
|
|
|
|
# Copy icon to Flutter assets
|
|
cp ./res/icon.png ./flutter/assets/icon.png
|
|
cp ./res/icon.png ./rustdesk/data/flutter_assets/assets/icon.png
|
|
|
|
# Convert PNG to SVG using potrace
|
|
magick ./res/icon.png -flatten ./temp_icon.pbm
|
|
potrace --svg -o ./flutter/assets/icon.svg ./temp_icon.pbm
|
|
cp ./flutter/assets/icon.svg ./rustdesk/data/flutter_assets/assets/icon.svg
|
|
rm ./temp_icon.pbm
|
|
|
|
# Create macOS app icons
|
|
magick ./res/icon.png -resize 16x16 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png"
|
|
magick ./res/icon.png -resize 32x32 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png"
|
|
magick ./res/icon.png -resize 64x64 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png"
|
|
magick ./res/icon.png -resize 128x128 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png"
|
|
magick ./res/icon.png -resize 256x256 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png"
|
|
magick ./res/icon.png -resize 512x512 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png"
|
|
magick ./res/icon.png -resize 1024x1024 "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png"
|
|
|
|
# Create macOS specific icons
|
|
magick ./res/icon.png -resize 128x128 ./res/mac-icon.png
|
|
|
|
# Create dark mode tray icon (optimized for macOS menu bar)
|
|
magick ./res/icon.png -resize 22x22 -colorspace gray -alpha set -background none -channel A -evaluate set 100% ./res/mac-tray-dark-x2.png
|
|
|
|
# Create light mode tray icon (optimized for macOS menu bar)
|
|
magick ./res/icon.png -resize 22x22 -negate -colorspace gray -alpha set -background none -channel A -evaluate set 100% ./res/mac-tray-light-x2.png
|
|
|
|
# Create AppIcon.icns (macOS native icon format)
|
|
mkdir -p ./iconset.iconset
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png" "./iconset.iconset/icon_16x16.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png" "./iconset.iconset/icon_16x16@2x.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png" "./iconset.iconset/icon_32x32.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png" "./iconset.iconset/icon_32x32@2x.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png" "./iconset.iconset/icon_128x128.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png" "./iconset.iconset/icon_128x128@2x.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png" "./iconset.iconset/icon_256x256.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png" "./iconset.iconset/icon_256x256@2x.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png" "./iconset.iconset/icon_512x512.png"
|
|
cp "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png" "./iconset.iconset/icon_512x512@2x.png"
|
|
iconutil -c icns ./iconset.iconset -o ./flutter/macos/Runner/AppIcon.icns
|
|
rm -rf ./iconset.iconset
|
|
|
|
# Create Contents.json for macOS app icon
|
|
echo '{
|
|
"images": [
|
|
{"size":"16x16","idiom":"mac","filename":"app_icon_16.png","scale":"1x"},
|
|
{"size":"16x16","idiom":"mac","filename":"app_icon_32.png","scale":"2x"},
|
|
{"size":"32x32","idiom":"mac","filename":"app_icon_32.png","scale":"1x"},
|
|
{"size":"32x32","idiom":"mac","filename":"app_icon_64.png","scale":"2x"},
|
|
{"size":"128x128","idiom":"mac","filename":"app_icon_128.png","scale":"1x"},
|
|
{"size":"128x128","idiom":"mac","filename":"app_icon_256.png","scale":"2x"},
|
|
{"size":"256x256","idiom":"mac","filename":"app_icon_256.png","scale":"1x"},
|
|
{"size":"256x256","idiom":"mac","filename":"app_icon_512.png","scale":"2x"},
|
|
{"size":"512x512","idiom":"mac","filename":"app_icon_512.png","scale":"1x"},
|
|
{"size":"512x512","idiom":"mac","filename":"app_icon_1024.png","scale":"2x"}
|
|
],
|
|
"info": {
|
|
"version": 1,
|
|
"author": "xcode"
|
|
}
|
|
}' > "flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json"
|
|
|
|
# Copy icons and Contents.json to both locations
|
|
cp -r flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/* macos/Runner/Assets.xcassets/AppIcon.appiconset/
|
|
|
|
# Verify files exist and show their sizes
|
|
echo "Verifying generated files:"
|
|
ls -lh ./res/mac-tray-dark-x2.png
|
|
ls -lh ./res/mac-tray-light-x2.png
|
|
ls -lh ./res/mac-icon.png
|
|
echo "Flutter macOS app icons:"
|
|
ls -lh flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/
|
|
echo "Flutter assets:"
|
|
ls -lh flutter/assets/icon.*
|
|
echo "RustDesk Flutter assets:"
|
|
ls -lh rustdesk/data/flutter_assets/assets/
|
|
|
|
- name: replace flutter icons
|
|
if: ${{ env.iconlink_url != 'false' }}
|
|
continue-on-error: false
|
|
shell: bash
|
|
run: |
|
|
cd ./flutter
|
|
# Create required directories and files
|
|
mkdir -p web
|
|
mkdir -p assets
|
|
echo '{"name":"${{ env.appname }}","short_name":"${{ env.appname }}","start_url":"/","display":"standalone","background_color":"#ffffff","theme_color":"#ffffff","description":"A remote desktop software."}' > web/manifest.json
|
|
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>${{ env.appname }}</title></head><body></body></html>' > web/index.html
|
|
|
|
# Ensure the AppIcon.appiconset directory exists
|
|
mkdir -p macos/Runner/Assets.xcassets/AppIcon.appiconset
|
|
|
|
# Copy the processed icons to Flutter locations
|
|
cp ../res/mac-icon.png ./assets/icon.png
|
|
cp ../flutter/assets/icon.svg ./assets/icon.svg || true
|
|
|
|
flutter pub upgrade win32
|
|
flutter pub get
|
|
flutter pub run flutter_launcher_icons
|
|
cd ..
|
|
|
|
- name: ui.rs
|
|
if: ${{ env.iconlink_url != 'false' }}
|
|
continue-on-error: true
|
|
shell: bash
|
|
run: |
|
|
cp ./src/ui.rs ./src/ui.rs.bak
|
|
if [ -f "./res/icon.png" ]; then
|
|
SEARCH_STR="iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAEiuAABIrgHwmhA7AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAEx9JREFUeJztnXmYHMV5h9"
|
|
b64=$(base64 < ./res/icon.png)
|
|
sed -i '' -e "s~$SEARCH_STR.*\"~$b64\"~" ./src/ui.rs
|
|
fi
|
|
|
|
- name: fix connection delay
|
|
continue-on-error: false
|
|
if: ${{ env.delayFix == 'true' }}
|
|
shell: bash
|
|
run: |
|
|
# Precise fix: only extend the direct-connection condition with the
|
|
# key check, instead of globally replacing !key.is_empty() with
|
|
# false (which would also disable TCP encryption and UDP logic).
|
|
sed -i -e 's#if is_local || peer_nat_type == NatType::SYMMETRIC {#if is_local || peer_nat_type == NatType::SYMMETRIC || !key.is_empty() {#' ./src/client.rs
|
|
grep -n "key.is_empty()" ./src/client.rs || true
|
|
|
|
- name: use X for offline display instead of orange circle
|
|
continue-on-error: true
|
|
if: env.xOffline == 'true'
|
|
run: |
|
|
cp .rdgen-src/.github/patches/xoffline.diff .
|
|
git apply xoffline.diff
|
|
|
|
- name: hide-cm
|
|
continue-on-error: true
|
|
if: env.hidecm == 'true'
|
|
run: |
|
|
cp .rdgen-src/.github/patches/hidecm.diff .
|
|
git apply hidecm.diff
|
|
|
|
- name: removeNewVersionNotif
|
|
continue-on-error: true
|
|
if: env.removeNewVersionNotif == 'true'
|
|
run: |
|
|
sed -i -e 's|updateUrl.isNotEmpty|false|' ./flutter/lib/desktop/pages/desktop_home_page.dart
|
|
sed -i '/let (request, url) =/,/Ok(())/{/Ok(())/!d}' ./src/common.rs
|
|
|
|
- name: Restore bridge files
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: bridge-artifact
|
|
path: ./
|
|
|
|
- name: Setup vcpkg with Github Actions binary cache
|
|
uses: lukka/run-vcpkg@1737e223b9c3f4fb07a7cf1cfa123cc243fcc0dd # v11 pinned to node20 runtime
|
|
with:
|
|
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
|
|
doNotCache: false
|
|
|
|
- name: Install vcpkg dependencies
|
|
run: |
|
|
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
|
|
head -n 100 "${VCPKG_ROOT}/buildtrees/ffmpeg/build-${{ matrix.job.vcpkg-triplet }}-rel-out.log" || true
|
|
|
|
- name: Create MacOS directory structure
|
|
run: |
|
|
mkdir -p ./build/macos/Build/Products/Release/RustDesk.app/Contents/MacOS
|
|
|
|
- name: Build rustdesk
|
|
run: |
|
|
if [ "${{ matrix.job.target }}" = "aarch64-apple-darwin" ]; then
|
|
MIN_MACOS_VERSION="12.3"
|
|
sed -i -e "s/MACOSX_DEPLOYMENT_TARGET\=[0-9]*.[0-9]*/MACOSX_DEPLOYMENT_TARGET=${MIN_MACOS_VERSION}/" build.py
|
|
sed -i -e "s/platform :osx, '.*'/platform :osx, '${MIN_MACOS_VERSION}'/" flutter/macos/Podfile
|
|
sed -i -e "s/osx_minimum_system_version = \"[0-9]*.[0-9]*\"/osx_minimum_system_version = \"${MIN_MACOS_VERSION}\"/" Cargo.toml
|
|
sed -i -e "s/MACOSX_DEPLOYMENT_TARGET = [0-9]*.[0-9]*;/MACOSX_DEPLOYMENT_TARGET = ${MIN_MACOS_VERSION};/" flutter/macos/Runner.xcodeproj/project.pbxproj
|
|
fi
|
|
sed -i -e "s/RustDesk.app/\"${{ env.appname }}.app\"/" build.py
|
|
./build.py --flutter --hwcodec --unix-file-copy-paste ${{ matrix.job.extra-build-args }}
|
|
|
|
# - name: Copy service file
|
|
# run: |
|
|
# cp -rf ../target/release/service ./build/macos/Build/Products/Release/RustDesk.app/Contents/MacOS/
|
|
|
|
- name: Embed custom config into the .app bundle
|
|
shell: bash
|
|
run: |
|
|
APP=$(find ./flutter/build/macos/Build/Products/Release -maxdepth 1 -name "*.app" | head -n 1)
|
|
echo "App bundle: $APP"
|
|
echo -n '${{ env.custom }}' > "$APP/Contents/MacOS/custom_.txt"
|
|
ls -l "$APP/Contents/MacOS/custom_.txt"
|
|
|
|
- name: Install rcodesign tool
|
|
if: env.MACOS_P12_BASE64 != ''
|
|
shell: bash
|
|
run: |
|
|
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: |
|
|
brew install llvm create-dmg nasm cmake gcc wget ninja
|
|
# pkg-config is handled in a separate step, because it may be already installed by `macos-latest`(14.7.1) runner
|
|
if command -v pkg-config &>/dev/null; then
|
|
echo "pkg-config is already installed"
|
|
else
|
|
brew install pkg-config
|
|
fi
|
|
|
|
- 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: icon svg handling
|
|
if: ${{ env.iconlink_url != 'false' }}
|
|
continue-on-error: false
|
|
shell: bash
|
|
run: |
|
|
# build.py renames the bundle to the custom app name: locate *.app
|
|
# dynamically instead of assuming RustDesk.app still exists.
|
|
APP=$(find ./flutter/build/macos/Build/Products/Release -maxdepth 1 -name "*.app" | head -n 1)
|
|
echo "App bundle: $APP"
|
|
ASSETS_DIR="$APP/Contents/Frameworks/App.framework/Versions/Current/Resources/flutter_assets/assets"
|
|
mkdir -p "$ASSETS_DIR"
|
|
if [ -f "$ASSETS_DIR/icon.svg" ]; then
|
|
mv "$ASSETS_DIR/icon.svg" "$ASSETS_DIR/icon.svg.bak"
|
|
fi
|
|
# First convert PNG to PBM (bitmap)
|
|
magick convert ./res/icon.png ./temp_icon.pbm
|
|
# Then use potrace to convert to SVG
|
|
potrace --svg -o "$ASSETS_DIR/icon.svg" ./temp_icon.pbm
|
|
rm ./temp_icon.pbm
|
|
|
|
- name: logo handling
|
|
if: ${{ env.logolink_url != 'false' }}
|
|
continue-on-error: false
|
|
shell: bash
|
|
run: |
|
|
# build.py renames the bundle to the custom app name: locate *.app
|
|
# dynamically instead of assuming RustDesk.app still exists.
|
|
APP=$(find ./flutter/build/macos/Build/Products/Release -maxdepth 1 -name "*.app" | head -n 1)
|
|
echo "App bundle: $APP"
|
|
ASSETS_DIR="$APP/Contents/Frameworks/App.framework/Versions/Current/Resources/flutter_assets/assets"
|
|
mkdir -p "$ASSETS_DIR"
|
|
curl -k -L --tlsv1.2 --proto =https --ssl-reqd \
|
|
-H "User-Agent: Mozilla/5.0" \
|
|
"${{ env.logolink_url }}/get_png?filename=${{ env.logolink_file }}&uuid=${{ env.logolink_uuid }}" \
|
|
-o "$ASSETS_DIR/logo.png" || \
|
|
wget --no-check-certificate \
|
|
-O "$ASSETS_DIR/logo.png" \
|
|
"${{ env.logolink_url }}/get_png?filename=${{ env.logolink_file }}&uuid=${{ env.logolink_uuid }}"
|
|
|
|
- name: Sign macOS app bundle
|
|
if: env.MACOS_P12_BASE64 != ''
|
|
run: |
|
|
cd flutter/build/macos/Build/Products/Release
|
|
# Debug info
|
|
echo "Current directory contents:"
|
|
ls -la
|
|
|
|
# Rename RustDesk.app to the custom app name first
|
|
if [ -d "RustDesk.app" ]; then
|
|
# First rename the app if it's still called RustDesk.app
|
|
mv "RustDesk.app" "${{ env.appname }}.app"
|
|
echo "Renamed RustDesk.app to ${{ env.appname }}.app"
|
|
fi
|
|
|
|
echo "App bundle contents after rename:"
|
|
ls -la "${{ env.appname }}.app" || echo "App not found"
|
|
ls -la "${{ env.appname }}.app/Contents" || echo "Contents not found"
|
|
|
|
# Decode the certificate
|
|
echo "${{ secrets.MACOS_P12_BASE64 }}" | base64 --decode > certificate.p12
|
|
|
|
# Sign the app bundle and its contents
|
|
if [ -d "${{ env.appname }}.app/Contents/MacOS" ]; then
|
|
echo "Signing main executable..."
|
|
MAIN_EXECUTABLE="${{ env.appname }}.app/Contents/MacOS/${{ env.appname }}"
|
|
if [ -f "$MAIN_EXECUTABLE" ]; then
|
|
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
|
|
--code-signature-flags runtime "$MAIN_EXECUTABLE"
|
|
else
|
|
echo "Main executable not found at expected path: $MAIN_EXECUTABLE"
|
|
# Try to find the actual executable
|
|
echo "Available executables in MacOS directory:"
|
|
ls -la "${{ env.appname }}.app/Contents/MacOS/"
|
|
ACTUAL_EXECUTABLE=$(ls "${{ env.appname }}.app/Contents/MacOS/" | head -n 1)
|
|
if [ -n "$ACTUAL_EXECUTABLE" ]; then
|
|
echo "Found executable: $ACTUAL_EXECUTABLE"
|
|
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
|
|
--code-signature-flags runtime "${{ env.appname }}.app/Contents/MacOS/$ACTUAL_EXECUTABLE"
|
|
fi
|
|
fi
|
|
|
|
echo "Signing frameworks..."
|
|
find "${{ env.appname }}.app/Contents/Frameworks" -type f -not -name ".*" -exec \
|
|
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
|
|
--code-signature-flags runtime {} \;
|
|
|
|
echo "Signing main bundle..."
|
|
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
|
|
--code-signature-flags runtime "${{ env.appname }}.app"
|
|
else
|
|
echo "Error: Invalid app bundle structure"
|
|
exit 1
|
|
fi
|
|
|
|
# Clean up
|
|
rm certificate.p12
|
|
|
|
- name: Ad-hoc Sign macOS app bundle (Fallback)
|
|
if: env.MACOS_P12_BASE64 == '' || env.MACOS_P12_BASE64 == null
|
|
shell: bash
|
|
run: |
|
|
cd flutter/build/macos/Build/Products/Release
|
|
|
|
# Renombrar RustDesk.app al nombre de la marca blanca si aplica
|
|
if [ -d "RustDesk.app" ]; then
|
|
mv "RustDesk.app" "${{ env.appname }}.app"
|
|
echo "RustDesk.app renombrado a ${{ env.appname }}.app"
|
|
fi
|
|
|
|
TARGET_APP="${{ env.appname }}.app"
|
|
|
|
if [ -d "$TARGET_APP" ]; then
|
|
echo "Limpiando atributos extendidos..."
|
|
xattr -cr "$TARGET_APP" || true
|
|
|
|
echo "Re-firmando $TARGET_APP de forma Ad-Hoc y recursiva..."
|
|
codesign --force --deep --sign - "$TARGET_APP"
|
|
echo "Firma Ad-Hoc completada con exito."
|
|
else
|
|
echo "Error: No se encontro la app bundle en $TARGET_APP para firmar."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Create DMG
|
|
run: |
|
|
cd $GITHUB_WORKSPACE/flutter/build/macos/Build/Products/Release
|
|
# Print directory contents for debugging
|
|
echo "Directory contents:"
|
|
ls -la
|
|
# Find the actual .app bundle
|
|
if [ -d "RustDesk.app" ]; then
|
|
# First rename the app if it's still called RustDesk.app
|
|
mv "RustDesk.app" "${{ env.appname }}.app"
|
|
fi
|
|
if [ ! -d "${{ env.appname }}.app" ]; then
|
|
echo "Could not find .app bundle!"
|
|
exit 1
|
|
fi
|
|
echo "Creating DMG for ${{ env.appname }}.app"
|
|
create-dmg \
|
|
--volname "${{ env.appname }}" \
|
|
--window-pos 200 120 \
|
|
--window-size 800 400 \
|
|
--icon-size 100 \
|
|
--icon "${{ env.appname }}.app" 200 190 \
|
|
--hide-extension "${{ env.appname }}.app" \
|
|
--app-drop-link 600 185 \
|
|
"${{ env.appname }}-${{ matrix.job.arch }}.dmg" \
|
|
"${{ env.appname }}.app"
|
|
mv "${{ env.appname }}-${{ matrix.job.arch }}.dmg" $GITHUB_WORKSPACE/
|
|
|
|
- name: Rename rustdesk
|
|
if: env.UPLOAD_ARTIFACT == 'true'
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
echo "Directory contents:"
|
|
ls -la
|
|
|
|
# Find the DMG file dynamically
|
|
DMG_FILE=$(find . -name "${{ env.appname }}-${{ matrix.job.arch }}.dmg")
|
|
|
|
if [ -n "$DMG_FILE" ]; then
|
|
echo "Found DMG file: $DMG_FILE"
|
|
mv "$DMG_FILE" "${{ env.filename }}-${{ matrix.job.arch }}.dmg"
|
|
echo "Renamed to ${{ env.filename }}-${{ matrix.job.arch }}.dmg"
|
|
else
|
|
echo "No DMG file found matching the pattern"
|
|
exit 1
|
|
fi
|
|
|
|
- name: send file to rdgen server
|
|
if: ${{ env.rdgen == 'true' }}
|
|
shell: bash
|
|
run: |
|
|
curl --fail -i -X POST --connect-timeout 10 --max-time 300 --retry 3 --retry-delay 5 \
|
|
-H "Content-Type: multipart/form-data" \
|
|
-H "Authorization: Bearer ${{ env.token }}" \
|
|
-F "file=@$GITHUB_WORKSPACE/${{ env.filename }}-${{ matrix.job.arch }}.dmg" \
|
|
-F "uuid=${{ env.uuid }}" \
|
|
"${{ secrets.GENURL }}/save_custom_client"
|
|
|
|
|
|
- name: send file to api server
|
|
if: ${{ env.rdgen == 'false' }}
|
|
shell: bash
|
|
run: |
|
|
curl --fail -i -X POST --connect-timeout 10 --max-time 300 --retry 3 --retry-delay 5 \
|
|
-H "Content-Type: multipart/form-data" \
|
|
-H "Authorization: Bearer ${{ env.token }}" \
|
|
-F "file=@$GITHUB_WORKSPACE/${{ env.filename }}-${{ matrix.job.arch }}.dmg" \
|
|
"${{ env.apiServer }}/api/save_custom_client"
|
|
|
|
cleanup:
|
|
needs: [build-for-macos]
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
if: always()
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: .rdgen-src
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: encrypted-secrets-zip
|
|
|
|
- name: Load Secrets
|
|
uses: ./.gitea/actions/decrypt-secrets
|
|
with:
|
|
zip_password: ${{ secrets.ZIP_PASSWORD }}
|
|
|
|
- name: Report build status
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
BUILD_RESULT: ${{ needs.build-for-macos.result }}
|
|
run: |
|
|
# Single aggregated callback for the x86_64/aarch64 matrix.
|
|
case "$BUILD_RESULT" in
|
|
success) STATUS=success ;;
|
|
cancelled) STATUS=cancelled ;;
|
|
*) STATUS=failure ;;
|
|
esac
|
|
if [ "${{ env.rdgen }}" = "false" ]; then
|
|
STATUS_URL="${{ env.apiServer }}/api/updategh"
|
|
else
|
|
STATUS_URL="${{ secrets.GENURL }}/updategh"
|
|
fi
|
|
if [ -z "${{ env.uuid }}" ]; then
|
|
echo "::warning::uuid missing, skip status callback"
|
|
exit 0
|
|
fi
|
|
echo "Reporting status=$STATUS for uuid=${{ env.uuid }}"
|
|
curl --fail --silent --show-error \
|
|
--connect-timeout 10 --max-time 30 --retry 3 --retry-delay 5 \
|
|
-X POST -H "Content-Type: application/json" \
|
|
-d "{\"uuid\":\"${{ env.uuid }}\",\"status\":\"$STATUS\"}" \
|
|
"$STATUS_URL" || echo "::warning::status callback failed"
|
|
|
|
- name: Delete secrets artifact
|
|
uses: geekyeggo/delete-artifact@v4
|
|
with:
|
|
name: encrypted-secrets-zip
|