From 72b53ee3932991ba9a0a6c3afc239a53240b9a25 Mon Sep 17 00:00:00 2001 From: Goooler Date: Sat, 3 Jan 2026 08:24:51 +0800 Subject: [PATCH 1/8] Add a final-status check on CI Also groups all required workflow jobs into the ci.yml file. You can enable the check in repo settings, this unblocks auto-merge for PRs. --- .github/workflows/ci.yml | 185 ++++++++++++++++++++++++++++++++ .github/workflows/dev-build.yml | 97 ----------------- .github/workflows/lint.yml | 57 ---------- .github/workflows/tests.yml | 95 ---------------- 4 files changed, 185 insertions(+), 249 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/dev-build.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d9ae2c7f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,185 @@ +name: CI + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + swiftlint: + name: SwiftLint + runs-on: macos-26 + timeout-minutes: 10 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - run: brew install swiftlint + - name: Run SwiftLint + run: | + swiftlint lint --strict --reporter github-actions-logging + + swiftformat: + name: SwiftFormat + runs-on: macos-26 + timeout-minutes: 10 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - run: brew install swiftformat + - name: Check formatting + run: | + swiftformat --lint . 2>&1 || { + echo "::error::Code is not formatted. Run 'swiftformat .' locally and commit the changes." + exit 1 + } + + macos_unit_tests: + name: macOS Unit Tests + timeout-minutes: 20 + runs-on: macos-26 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer + - name: Show Xcode version + run: xcodebuild -version + - name: Run unit tests + run: | + set -o pipefail + xcodebuild \ + -project Kaset.xcodeproj \ + -scheme Kaset \ + -destination 'platform=macOS' \ + -derivedDataPath ./build \ + -only-testing:KasetTests \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGNING_ALLOWED=NO \ + test + - name: Upload test results on failure + if: failure() + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + with: + name: macOS-TestResults + path: ./build/*.xcresult + retention-days: 7 + + macos_ui_tests: + name: macOS UI Tests + timeout-minutes: 30 + runs-on: macos-26 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer + - name: Show Xcode version + run: xcodebuild -version + - name: Run UI tests + run: | + set -o pipefail + xcodebuild \ + -project Kaset.xcodeproj \ + -scheme Kaset \ + -destination 'platform=macOS' \ + -derivedDataPath ./build \ + -only-testing:KasetUITests \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGNING_ALLOWED=NO \ + test + - name: Upload test results on failure + if: failure() + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + with: + name: macOS-UITestResults + path: ./build/*.xcresult + retention-days: 7 + + build: + runs-on: macos-26 + timeout-minutes: 30 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer + - name: Show Xcode version + run: xcodebuild -version + - name: Get short SHA + id: slug + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build app + run: | + xcodebuild -project Kaset.xcodeproj \ + -scheme Kaset \ + -configuration Release \ + -derivedDataPath ./build \ + -destination 'platform=macOS' \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGNING_ALLOWED=NO \ + ARCHS="arm64 x86_64" \ + ONLY_ACTIVE_ARCH=NO \ + MARKETING_VERSION="0.0.0-dev.${{ steps.slug.outputs.sha_short }}" \ + CURRENT_PROJECT_VERSION="${{ github.run_number }}" + - name: Create DMG + run: | + APP_NAME="Kaset.app" + BUILD_DIR="./build/Build/Products/Release" + + # debug: show what's in the build folder + echo "Contents of $BUILD_DIR:" + ls -la "$BUILD_DIR" || true + + # clean previous artifacts + rm -rf dmg_contents kaset-dev.dmg + + # find the main app explicitly by name + APP_PATH=$(find "$BUILD_DIR" -type d -name "$APP_NAME" | head -n 1) + + if [ -z "$APP_PATH" ]; then + echo "Error: Could not find $APP_NAME in $BUILD_DIR" + exit 1 + fi + + echo "Found app at: $APP_PATH" + + # Create a temporary directory for DMG contents + mkdir -p dmg_contents + cp -R "$APP_PATH" dmg_contents/ + + # Create DMG + hdiutil create -volname "Kaset-dev" \ + -srcfolder dmg_contents \ + -ov -format UDZO \ + kaset-dev.dmg + - name: Upload DMG + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + if: github.event_name != 'pull_request' + with: + name: kaset-dev-${{ steps.slug.outputs.sha_short }} + path: kaset-dev.dmg + retention-days: 30 + + # Status check that is required in branch protection rules. + final-status: + needs: + - swiftlint + - swiftformat + - macos_unit_tests + - macos_ui_tests + - build + runs-on: ubuntu-latest + if: always() + steps: + - name: Check + run: | + results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}') + if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then + echo "One or more required jobs failed" + exit 1 + fi + echo "All required jobs completed successfully." diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml deleted file mode 100644 index e572702c..00000000 --- a/.github/workflows/dev-build.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Dev Build - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: [main] - paths: - - "**.swift" - - "**.xcodeproj/**" - - "**.xcworkspace/**" - - "Assets.xcassets/**" - - ".github/workflows/dev-build.yml" - pull_request: - paths: - - "**.swift" - - "**.xcodeproj/**" - - "**.xcworkspace/**" - - "Assets.xcassets/**" - - ".github/workflows/dev-build.yml" - workflow_dispatch: - -jobs: - build: - runs-on: macos-26 - timeout-minutes: 30 - - steps: - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - - name: Select Xcode version - run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - - - name: Show Xcode version - run: xcodebuild -version - - - name: Get short SHA - id: slug - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Build app - run: | - xcodebuild -project Kaset.xcodeproj \ - -scheme Kaset \ - -configuration Release \ - -derivedDataPath ./build \ - -destination 'platform=macOS' \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - ARCHS="arm64 x86_64" \ - ONLY_ACTIVE_ARCH=NO \ - MARKETING_VERSION="0.0.0-dev.${{ steps.slug.outputs.sha_short }}" \ - CURRENT_PROJECT_VERSION="${{ github.run_number }}" - - - name: Create DMG - run: | - APP_NAME="Kaset.app" - BUILD_DIR="./build/Build/Products/Release" - - # debug: show what's in the build folder - echo "Contents of $BUILD_DIR:" - ls -la "$BUILD_DIR" || true - - # clean previous artifacts - rm -rf dmg_contents kaset-dev.dmg - - # find the main app explicitly by name - APP_PATH=$(find "$BUILD_DIR" -type d -name "$APP_NAME" | head -n 1) - - if [ -z "$APP_PATH" ]; then - echo "Error: Could not find $APP_NAME in $BUILD_DIR" - exit 1 - fi - - echo "Found app at: $APP_PATH" - - # Create a temporary directory for DMG contents - mkdir -p dmg_contents - cp -R "$APP_PATH" dmg_contents/ - - # Create DMG - hdiutil create -volname "Kaset-dev" \ - -srcfolder dmg_contents \ - -ov -format UDZO \ - kaset-dev.dmg - - - name: Upload DMG - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 - if: github.event_name != 'pull_request' - with: - name: kaset-dev-${{ steps.slug.outputs.sha_short }} - path: kaset-dev.dmg - retention-days: 30 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 44cf7db6..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Lint & Format - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: [main] - paths: - - "**.swift" - - ".swiftlint.yml" - - ".swiftformat" - - ".github/workflows/lint.yml" - pull_request: - branches: [main] - paths: - - "**.swift" - - ".swiftlint.yml" - - ".swiftformat" - - ".github/workflows/lint.yml" - -jobs: - swiftlint: - name: SwiftLint - runs-on: macos-26 - timeout-minutes: 10 - - steps: - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - - name: Install SwiftLint - run: brew install swiftlint - - - name: Run SwiftLint - run: | - swiftlint lint --strict --reporter github-actions-logging - - swiftformat: - name: SwiftFormat - runs-on: macos-26 - timeout-minutes: 10 - - steps: - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - - name: Install SwiftFormat - run: brew install swiftformat - - - name: Check formatting - run: | - swiftformat --lint . 2>&1 || { - echo "::error::Code is not formatted. Run 'swiftformat .' locally and commit the changes." - exit 1 - } diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 99fc1e86..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Test Suite - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: [main] - paths: - - "**.swift" - - "**.xcodeproj/**" - - "**.xcworkspace/**" - - ".github/workflows/tests.yml" - pull_request: - branches: [main] - paths: - - "**.swift" - - "**.xcodeproj/**" - - "**.xcworkspace/**" - - ".github/workflows/tests.yml" - workflow_dispatch: - -jobs: - macos_unit_tests: - name: macOS Unit Tests - timeout-minutes: 20 - runs-on: macos-26 - steps: - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - - name: Select Xcode version - run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - - - name: Show Xcode version - run: xcodebuild -version - - - name: Run unit tests - run: | - set -o pipefail - xcodebuild \ - -project Kaset.xcodeproj \ - -scheme Kaset \ - -destination 'platform=macOS' \ - -derivedDataPath ./build \ - -only-testing:KasetTests \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - test - - - name: Upload test results on failure - if: failure() - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 - with: - name: macOS-TestResults - path: ./build/*.xcresult - retention-days: 7 - - macos_ui_tests: - name: macOS UI Tests - timeout-minutes: 30 - runs-on: macos-26 - steps: - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - - name: Select Xcode version - run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - - - name: Show Xcode version - run: xcodebuild -version - - - name: Run UI tests - run: | - set -o pipefail - xcodebuild \ - -project Kaset.xcodeproj \ - -scheme Kaset \ - -destination 'platform=macOS' \ - -derivedDataPath ./build \ - -only-testing:KasetUITests \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - test - - - name: Upload test results on failure - if: failure() - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 - with: - name: macOS-UITestResults - path: ./build/*.xcresult - retention-days: 7 From 7416951f3690bde7caed8d2c333173fdfa612532 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Sat, 3 Jan 2026 08:29:29 +0800 Subject: [PATCH 2/8] Update .github/workflows/ci.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9ae2c7f..c90ba3a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,6 +100,7 @@ jobs: retention-days: 7 build: + name: Build runs-on: macos-26 timeout-minutes: 30 steps: From 93584c18e9eaa9a53012615d48f85af42241b36e Mon Sep 17 00:00:00 2001 From: Goooler Date: Sun, 4 Jan 2026 09:22:45 +0800 Subject: [PATCH 3/8] Rename jobs --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c90ba3a9..968ba106 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ on: jobs: swiftlint: - name: SwiftLint + name: Swift Lint runs-on: macos-26 timeout-minutes: 10 steps: @@ -24,7 +24,7 @@ jobs: swiftlint lint --strict --reporter github-actions-logging swiftformat: - name: SwiftFormat + name: Swift Format runs-on: macos-26 timeout-minutes: 10 steps: @@ -167,6 +167,7 @@ jobs: # Status check that is required in branch protection rules. final-status: + name: Final Status needs: - swiftlint - swiftformat From 5111af89334a7cd230b2fb26cd2ae04ec554e81c Mon Sep 17 00:00:00 2001 From: Goooler Date: Sun, 4 Jan 2026 09:39:42 +0800 Subject: [PATCH 4/8] Cache build dirs --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 968ba106..da47f55c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,12 @@ jobs: runs-on: macos-26 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/cache@v5 + with: + path: ./build + key: ${{ runner.os }}-xcode-build-${{ hashFiles('**/project.pbxproj', '**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-xcode-build- - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -74,6 +80,12 @@ jobs: runs-on: macos-26 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/cache@v5 + with: + path: ./build + key: ${{ runner.os }}-xcode-build-${{ hashFiles('**/project.pbxproj', '**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-xcode-build- - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -105,6 +117,12 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/cache@v5 + with: + path: ./build + key: ${{ runner.os }}-xcode-build-${{ hashFiles('**/project.pbxproj', '**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-xcode-build- - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version From f03c4bef024d3632a91d86b452f617b5749dbf82 Mon Sep 17 00:00:00 2001 From: Goooler Date: Thu, 8 Jan 2026 07:56:35 +0800 Subject: [PATCH 5/8] Revert "Cache build dirs" This reverts commit 5111af89334a7cd230b2fb26cd2ae04ec554e81c. --- .github/workflows/ci.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da47f55c..968ba106 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,12 +43,6 @@ jobs: runs-on: macos-26 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - uses: actions/cache@v5 - with: - path: ./build - key: ${{ runner.os }}-xcode-build-${{ hashFiles('**/project.pbxproj', '**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-xcode-build- - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -80,12 +74,6 @@ jobs: runs-on: macos-26 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - uses: actions/cache@v5 - with: - path: ./build - key: ${{ runner.os }}-xcode-build-${{ hashFiles('**/project.pbxproj', '**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-xcode-build- - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -117,12 +105,6 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 - - uses: actions/cache@v5 - with: - path: ./build - key: ${{ runner.os }}-xcode-build-${{ hashFiles('**/project.pbxproj', '**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-xcode-build- - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version From 6b0b48924087501e46907e4ede19daf2bebbcdc2 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 26 Jan 2026 13:14:55 +0800 Subject: [PATCH 6/8] Fix merge --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 968ba106..381af86c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: macos-26 timeout-minutes: 10 steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - run: brew install swiftlint - name: Run SwiftLint run: | @@ -28,7 +28,7 @@ jobs: runs-on: macos-26 timeout-minutes: 10 steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - run: brew install swiftformat - name: Check formatting run: | @@ -42,7 +42,7 @@ jobs: timeout-minutes: 20 runs-on: macos-26 steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -73,7 +73,7 @@ jobs: timeout-minutes: 30 runs-on: macos-26 steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -104,7 +104,7 @@ jobs: runs-on: macos-26 timeout-minutes: 30 steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version From 70900ae0651120f41d4699f9c426195679ca8039 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 26 Jan 2026 13:15:54 +0800 Subject: [PATCH 7/8] Update comments --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/release.yml | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 381af86c..4e919152 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: macos-26 timeout-minutes: 10 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - run: brew install swiftlint - name: Run SwiftLint run: | @@ -28,7 +28,7 @@ jobs: runs-on: macos-26 timeout-minutes: 10 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - run: brew install swiftformat - name: Check formatting run: | @@ -42,7 +42,7 @@ jobs: timeout-minutes: 20 runs-on: macos-26 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -62,7 +62,7 @@ jobs: test - name: Upload test results on failure if: failure() - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: name: macOS-TestResults path: ./build/*.xcresult @@ -73,7 +73,7 @@ jobs: timeout-minutes: 30 runs-on: macos-26 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -93,7 +93,7 @@ jobs: test - name: Upload test results on failure if: failure() - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: name: macOS-UITestResults path: ./build/*.xcresult @@ -104,7 +104,7 @@ jobs: runs-on: macos-26 timeout-minutes: 30 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version @@ -158,7 +158,7 @@ jobs: -ov -format UDZO \ kaset-dev.dmg - name: Upload DMG - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 if: github.event_name != 'pull_request' with: name: kaset-dev-${{ steps.slug.outputs.sha_short }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 339b6011..db77e3a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 # Full history for changelog generation @@ -167,7 +167,7 @@ jobs: run: mv kaset.dmg "${{ steps.artifact.outputs.filename }}" - name: Upload artifact - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: name: ${{ steps.artifact.outputs.filename }} path: ${{ steps.artifact.outputs.filename }} @@ -308,7 +308,7 @@ jobs: fi - name: Checkout Homebrew tap repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: repository: sozercan/homebrew-repo token: ${{ secrets.HOMEBREW_REPO_TOKEN }} From 935ce1f5b5fc96c1be7fb055b5e886d348a568a0 Mon Sep 17 00:00:00 2001 From: Goooler Date: Sat, 28 Feb 2026 13:58:15 +0800 Subject: [PATCH 8/8] Fix merge --- .github/workflows/ci.yml | 80 +++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e919152..93129b53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,21 +45,12 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - - name: Show Xcode version - run: xcodebuild -version + - name: Show Swift version + run: swift --version + - name: Clear SPM artifacts cache + run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts - name: Run unit tests - run: | - set -o pipefail - xcodebuild \ - -project Kaset.xcodeproj \ - -scheme Kaset \ - -destination 'platform=macOS' \ - -derivedDataPath ./build \ - -only-testing:KasetTests \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - test + run: swift test -q --skip KasetUITests - name: Upload test results on failure if: failure() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 @@ -78,16 +69,26 @@ jobs: run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - name: Show Xcode version run: xcodebuild -version + - name: Clear SPM artifacts cache + run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts + - name: Build app bundle for UI tests + env: + KASET_SIGNING: adhoc + run: Scripts/build-app.sh debug + - name: Install app for UI tests + run: | + sudo cp -R .build/app/Kaset.app /Applications/Kaset.app + # Register with Launch Services so XCUIApplication can find it + /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/Kaset.app - name: Run UI tests run: | set -o pipefail xcodebuild \ - -project Kaset.xcodeproj \ - -scheme Kaset \ + -project KasetUITests.xcodeproj \ + -scheme KasetUITests \ -destination 'platform=macOS' \ -derivedDataPath ./build \ - -only-testing:KasetUITests \ - CODE_SIGN_IDENTITY="" \ + CODE_SIGN_IDENTITY="-" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO \ test @@ -107,42 +108,29 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Select Xcode version run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - - name: Show Xcode version - run: xcodebuild -version + - name: Show Swift version + run: swift --version + - name: Clear SPM artifacts cache + run: rm -rf ~/Library/Caches/org.swift.swiftpm/artifacts - name: Get short SHA id: slug run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Build app + env: + KASET_SIGNING: adhoc + ARCHES: "arm64 x86_64" run: | - xcodebuild -project Kaset.xcodeproj \ - -scheme Kaset \ - -configuration Release \ - -derivedDataPath ./build \ - -destination 'platform=macOS' \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - ARCHS="arm64 x86_64" \ - ONLY_ACTIVE_ARCH=NO \ - MARKETING_VERSION="0.0.0-dev.${{ steps.slug.outputs.sha_short }}" \ - CURRENT_PROJECT_VERSION="${{ github.run_number }}" + # Override version for dev builds + echo "MARKETING_VERSION=0.0.0-dev.${{ steps.slug.outputs.sha_short }}" > version.env + echo "BUILD_NUMBER=${{ github.run_number }}" >> version.env + Scripts/build-app.sh release + - name: Create DMG run: | - APP_NAME="Kaset.app" - BUILD_DIR="./build/Build/Products/Release" - - # debug: show what's in the build folder - echo "Contents of $BUILD_DIR:" - ls -la "$BUILD_DIR" || true - - # clean previous artifacts - rm -rf dmg_contents kaset-dev.dmg - - # find the main app explicitly by name - APP_PATH=$(find "$BUILD_DIR" -type d -name "$APP_NAME" | head -n 1) + APP_PATH=".build/app/Kaset.app" - if [ -z "$APP_PATH" ]; then - echo "Error: Could not find $APP_NAME in $BUILD_DIR" + if [ ! -d "$APP_PATH" ]; then + echo "Error: Could not find Kaset.app" exit 1 fi