diff --git a/.github/workflows/macos-beta.yml b/.github/workflows/macos-beta.yml new file mode 100644 index 000000000..52d7df28c --- /dev/null +++ b/.github/workflows/macos-beta.yml @@ -0,0 +1,59 @@ +name: macOS Beta Build + +on: + workflow_dispatch: + +jobs: + build-macos-beta: + runs-on: macos-15 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install Qt 5 from Homebrew + run: | + brew install qt@5 + echo "$(brew --prefix qt@5)/bin" >> "$GITHUB_PATH" + + - name: Show build environment + run: | + uname -m + which qmake + qmake -v + xcode-select -p + + - name: Clean macOS build directory + run: rm -rf build/macos/* + + - name: Build macOS test app + run: | + qmake -config release "CONFIG += release_macos build_original" QMAKE_APPLE_DEVICE_ARCHS=arm64 + make clean + make -j"$(sysctl -n hw.ncpu)" + rm -rf build/macos/obj + + - name: Deploy Qt runtime into app bundle + run: | + macdeployqt "build/macos/VESC Tool.app" -qmldir="$GITHUB_WORKSPACE" -verbose=2 + + - name: Sign app bundle + run: | + find "build/macos/VESC Tool.app/Contents/Frameworks" -type f \( -name '*.dylib' -o -path '*/Versions/5/*' \) -print0 | xargs -0 -I {} codesign --force --sign - "{}" + find "build/macos/VESC Tool.app/Contents/PlugIns" -type f -name '*.dylib' -print0 | xargs -0 -I {} codesign --force --sign - "{}" + codesign --force --sign - "build/macos/VESC Tool.app/Contents/MacOS/VESC Tool" + codesign --force --deep --sign - "build/macos/VESC Tool.app" + codesign --verify --deep --strict --verbose=2 "build/macos/VESC Tool.app" + + - name: Package build output + run: | + cd build/macos + zip -r "vesc_tool_macos_test_${GITHUB_SHA::8}.zip" . -x "*.zip" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: vesc-tool-macos-test-${{ github.sha }} + path: build/macos/*.zip + if-no-files-found: error + retention-days: 7 diff --git a/README.md b/README.md index 211d4e088..a8fb81285 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,26 @@ If you have custom hardware and you want to add support for it in the official r **Note:** These instructions build VESC Tool without the BLDC firmwares bundled. +### macOS Beta Build with GitHub Actions + +A manual GitHub Actions workflow is available for building an arm64 macOS test build. + +1. Open the **Actions** tab in GitHub. +2. Select the **macOS Beta Build** workflow. +3. Click **Run workflow**. +4. Wait for the workflow to finish and download the generated artifact. +5. Unzip the artifact on a macOS machine to get `VESC Tool.app`. + +The workflow is defined in `.github/workflows/macos-beta.yml` and builds the `build_original` variant using the repository default test version. + +If macOS blocks the downloaded app because it has the quarantine attribute, remove it with: + +```shell +xattr -dr com.apple.quarantine "VESC Tool.app" +``` + +After that, start the app again. + ### Linux Make sure that the required dependencies are installed. There is some advice in the [build_lin](./build_lin) file's comments. If you have Nix installed see below. diff --git a/vesc_tool.pro b/vesc_tool.pro index 9bfb1428a..91d401706 100644 --- a/vesc_tool.pro +++ b/vesc_tool.pro @@ -347,7 +347,9 @@ macx { QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO - QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 + isEmpty(QMAKE_APPLE_DEVICE_ARCHS) { + QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 + } } ios {