| 1 | name: Build Native macOS App |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [ main ] |
| 6 | paths: |
| 7 | - 'ios/**' |
| 8 | - '!ios/**/*.md' |
| 9 | - '.github/workflows/build-apps.yml' |
| 10 | pull_request: |
| 11 | types: [opened, synchronize, reopened, ready_for_review] |
| 12 | paths: |
| 13 | - 'ios/**' |
| 14 | - '!ios/**/*.md' |
| 15 | workflow_dispatch: |
| 16 | |
| 17 | concurrency: |
| 18 | group: build-apps-${{ github.ref }} |
| 19 | cancel-in-progress: true |
| 20 | |
| 21 | jobs: |
| 22 | build: |
| 23 | runs-on: macos-latest |
| 24 | if: false |
| 25 | permissions: |
| 26 | contents: write |
| 27 | |
| 28 | steps: |
| 29 | - name: Checkout code |
| 30 | uses: actions/checkout@v4 |
| 31 | with: |
| 32 | # Nothing here pushes back to the repo — the release step uses the |
| 33 | # GITHUB_TOKEN via the API, not the persisted git credential. |
| 34 | persist-credentials: false |
| 35 | |
| 36 | - name: Install xcodegen |
| 37 | run: brew install xcodegen |
| 38 | |
| 39 | - name: Generate Xcode project |
| 40 | working-directory: ios |
| 41 | run: xcodegen generate |
| 42 | |
| 43 | - name: Cache Swift Package Manager checkouts |
| 44 | uses: actions/cache@v4 |
| 45 | with: |
| 46 | path: ios/build/SourcePackages |
| 47 | key: spm-${{ runner.os }}-${{ hashFiles('ios/project.yml') }} |
| 48 | restore-keys: | |
| 49 | spm-${{ runner.os }}- |
| 50 | |
| 51 | - name: Build macOS (native) |
| 52 | working-directory: ios |
| 53 | run: | |
| 54 | xcodebuild -project LChat.xcodeproj -scheme LChatMac \ |
| 55 | -destination 'generic/platform=macOS' \ |
| 56 | -derivedDataPath build \ |
| 57 | CODE_SIGN_STYLE=Automatic \ |
| 58 | CODE_SIGN_IDENTITY='-' \ |
| 59 | build |
| 60 | |
| 61 | - name: Package app |
| 62 | run: | |
| 63 | cd ios/build/Build/Products/Debug |
| 64 | ditto -c -k --sequesterRsrc --keepParent Eleven.app Eleven.app.zip |
| 65 | ls -lh Eleven.app.zip |
| 66 | |
| 67 | - name: Create release |
| 68 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 69 | # Third-party action, so pinned by commit (a mutable tag could be |
| 70 | # repointed at hostile code that sees this job's contents: write). |
| 71 | uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 |
| 72 | with: |
| 73 | files: ios/build/Build/Products/Debug/Eleven.app.zip |
| 74 | tag_name: app-build-${{ github.run_number }} |
| 75 | name: App Build ${{ github.run_number }} |
| 76 | body: | |
| 77 | Built from commit ${{ github.sha }} |
| 78 | |
| 79 | ## Download & Run |
| 80 | |
| 81 | 1. Download `Eleven.app.zip` |
| 82 | 2. Unzip it |
| 83 | 3. Open Terminal and run: |
| 84 | ```bash |
| 85 | xattr -d com.apple.quarantine ~/Downloads/Eleven.app |
| 86 | ``` |
| 87 | 4. Double-click `Eleven.app` to launch |
| 88 | |
| 89 | (The `xattr` command removes macOS's quarantine flag so the app can run without security warnings.) |
| 90 | |
| 91 | - name: Upload artifacts for PR |
| 92 | if: github.event_name == 'pull_request' |
| 93 | uses: actions/upload-artifact@v4 |
| 94 | with: |
| 95 | name: Eleven.app |
| 96 | path: ios/build/Build/Products/Debug/Eleven.app.zip |
| 97 | retention-days: 7 |
| 98 | |