From 97571c7297e16cf03e0f5c34a8dcf6b8675b5826 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 13:59:27 +0000 Subject: [PATCH] Fix(actions): Correct sed and wget in macOS generator The `generator-macos.yml` workflow was failing on macOS runners due to two main issues: 1. The `sed` commands were using the GNU/Linux `-i -e` syntax, which is not compatible with the BSD `sed` found on macOS. This has been corrected to use the `sed -i '' -e` syntax. 2. The workflow was fetching patches using hardcoded `wget` URLs pointing to the original repository. This has been changed to use dynamic GitHub context variables (`${{ github.repository }}` and `${{ github.ref_name }}`) to ensure the workflow uses the patches from the forked repository it is running in. These changes should resolve the workflow failures and make it more robust for use in forks. --- .github/workflows/generator-macos.yml | 44 +++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/generator-macos.yml b/.github/workflows/generator-macos.yml index 0cc67de..ec235e6 100644 --- a/.github/workflows/generator-macos.yml +++ b/.github/workflows/generator-macos.yml @@ -168,8 +168,8 @@ jobs: sed -i '' -e 's|Purslane Ltd.|${{ inputs.appname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig # Keep DEVELOPMENT_TEAM if it exists, don't blank it out - sed -i -e 's|Purslane Ltd.|${{ inputs.appname }}|' ./Cargo.toml - sed -i -e 's|Purslane Ltd|${{ inputs.appname }}|' ./libs/portable/Cargo.toml + sed -i '' -e 's|Purslane Ltd.|${{ inputs.appname }}|' ./Cargo.toml + sed -i '' -e 's|Purslane Ltd|${{ inputs.appname }}|' ./libs/portable/Cargo.toml # Update Xcode project settings sed -i '' -e 's/PRODUCT_NAME = "RustDesk"/PRODUCT_NAME = "${{ inputs.appname }}"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj @@ -203,9 +203,9 @@ jobs: continue-on-error: true shell: bash run: | - sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart - sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart - sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis + sed -i '' -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart + sed -i '' -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart + sed -i '' -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis # Update slogan #sed -i '' '/NSHumanReadableCopyright<\/key>/{n;s/.*<\/string>/Copyright 2025 ${{ inputs.appname }}. All rights reserved.<\/string>/;}' ./flutter/macos/Runner/Info.plist @@ -221,13 +221,13 @@ jobs: sed -i '' -e 's/("About RustDesk", "Over RustDesk")/("About RustDesk", "Over ${{ inputs.appname }}")/' ./src/lang/nl.rs sed -i '' -e 's/("About", "Over")/("About", "Over ${{ inputs.appname }}")/' ./src/lang/nl.rs - sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs - sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs - sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs + sed -i '' -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs + sed -i '' -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs + sed -i '' -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs - wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff + wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/.github/patches/allowCustom.diff git apply allowCustom.diff - wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff + wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/.github/patches/removeSetupServerTip.diff git apply removeSetupServerTip.diff # Update pubspec.yaml with proper YAML formatting @@ -272,7 +272,7 @@ jobs: run: | cd "$(dirname "$(which flutter)")" # https://github.com/flutter/flutter/issues/1.3.43 - sed -i -e 's/_setFramesEnabledState(false);/\/\/_setFramesEnabledState(false);/g' ../packages/flutter/lib/src/scheduler/binding.dart + 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 @@ -437,35 +437,35 @@ jobs: if: ${{ fromJson(inputs.extras).delayFix == 'true' }} shell: bash run: | - sed -i -e 's|!key.is_empty()|false|' ./src/client.rs + sed -i '' -e 's|!key.is_empty()|false|' ./src/client.rs - name: add cycle monitors to toolbar continue-on-error: true if: fromJson(inputs.extras).cycleMonitor == 'true' run: | - wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/cycle_monitor.diff + wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/.github/patches/cycle_monitor.diff git apply cycle_monitor.diff - name: use X for offline display instead of orange circle continue-on-error: true if: fromJson(inputs.extras).xOffline == 'true' run: | - wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff + wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/.github/patches/xoffline.diff git apply xoffline.diff - name: hide-cm continue-on-error: true if: fromJson(inputs.extras).hidecm == 'true' run: | - wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff + wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/.github/patches/hidecm.diff git apply hidecm.diff - name: removeNewVersionNotif continue-on-error: true if: fromJson(inputs.extras).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 + 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: Report Status uses: fjogeleit/http-request-action@v1 @@ -527,12 +527,12 @@ jobs: 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 + 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/\"${{ inputs.appname }}.app\"/" build.py + sed -i '' -e "s/RustDesk.app/\"${{ inputs.appname }}.app\"/" build.py ./build.py --flutter --hwcodec --unix-file-copy-paste ${{ matrix.job.extra-build-args }} # - name: Copy service file -- 2.49.1