|
| 1 | +name: Desktop App Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - PRODUCTION |
| 8 | + paths: |
| 9 | + - 'apps/desktop/**' |
| 10 | + - '.github/workflows/desktop-build.yml' |
| 11 | + pull_request: |
| 12 | + paths: |
| 13 | + - 'apps/desktop/**' |
| 14 | + workflow_dispatch: |
| 15 | + inputs: |
| 16 | + create_release: |
| 17 | + description: 'Create GitHub release' |
| 18 | + required: false |
| 19 | + type: boolean |
| 20 | + default: false |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: write |
| 24 | + packages: write |
| 25 | + |
| 26 | +jobs: |
| 27 | + build-macos: |
| 28 | + runs-on: macos-latest |
| 29 | + steps: |
| 30 | + - name: Checkout code |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Setup Node.js |
| 34 | + uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: '20' |
| 37 | + cache: 'npm' |
| 38 | + cache-dependency-path: apps/desktop/package-lock.json |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + working-directory: apps/desktop |
| 42 | + run: npm ci |
| 43 | + |
| 44 | + - name: Build macOS app |
| 45 | + working-directory: apps/desktop |
| 46 | + run: npm run build:mac |
| 47 | + env: |
| 48 | + # Skip notarization in CI (requires Apple Developer credentials) |
| 49 | + CSC_IDENTITY_AUTO_DISCOVERY: false |
| 50 | + |
| 51 | + - name: List build outputs |
| 52 | + working-directory: apps/desktop |
| 53 | + run: ls -lah dist/ |
| 54 | + |
| 55 | + - name: Upload macOS artifacts |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: kortix-macos-${{ github.sha }} |
| 59 | + path: | |
| 60 | + apps/desktop/dist/*.dmg |
| 61 | + retention-days: 30 |
| 62 | + |
| 63 | + build-windows: |
| 64 | + runs-on: windows-latest |
| 65 | + steps: |
| 66 | + - name: Checkout code |
| 67 | + uses: actions/checkout@v4 |
| 68 | + |
| 69 | + - name: Setup Node.js |
| 70 | + uses: actions/setup-node@v4 |
| 71 | + with: |
| 72 | + node-version: '20' |
| 73 | + cache: 'npm' |
| 74 | + cache-dependency-path: apps/desktop/package-lock.json |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + working-directory: apps/desktop |
| 78 | + run: npm ci |
| 79 | + |
| 80 | + - name: Build Windows app |
| 81 | + working-directory: apps/desktop |
| 82 | + run: npm run build:win |
| 83 | + env: |
| 84 | + # Skip code signing in CI (requires Windows code signing certificate) |
| 85 | + CSC_IDENTITY_AUTO_DISCOVERY: false |
| 86 | + |
| 87 | + - name: List build outputs |
| 88 | + working-directory: apps/desktop |
| 89 | + run: dir dist\ |
| 90 | + |
| 91 | + - name: Upload Windows artifacts |
| 92 | + uses: actions/upload-artifact@v4 |
| 93 | + with: |
| 94 | + name: kortix-windows-${{ github.sha }} |
| 95 | + path: | |
| 96 | + apps/desktop/dist/*.exe |
| 97 | + retention-days: 30 |
| 98 | + |
| 99 | + create-release: |
| 100 | + needs: [build-macos, build-windows] |
| 101 | + runs-on: ubuntu-latest |
| 102 | + if: | |
| 103 | + github.event_name == 'workflow_dispatch' && |
| 104 | + github.event.inputs.create_release == 'true' || |
| 105 | + github.ref == 'refs/heads/PRODUCTION' |
| 106 | + steps: |
| 107 | + - name: Checkout code |
| 108 | + uses: actions/checkout@v4 |
| 109 | + |
| 110 | + - name: Get version from package.json |
| 111 | + id: version |
| 112 | + working-directory: apps/desktop |
| 113 | + run: | |
| 114 | + VERSION=$(node -p "require('./package.json').version") |
| 115 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 116 | + echo "tag=v$VERSION" >> $GITHUB_OUTPUT |
| 117 | +
|
| 118 | + - name: Download macOS artifacts |
| 119 | + uses: actions/download-artifact@v4 |
| 120 | + with: |
| 121 | + name: kortix-macos-${{ github.sha }} |
| 122 | + path: ./artifacts/macos |
| 123 | + |
| 124 | + - name: Download Windows artifacts |
| 125 | + uses: actions/download-artifact@v4 |
| 126 | + with: |
| 127 | + name: kortix-windows-${{ github.sha }} |
| 128 | + path: ./artifacts/windows |
| 129 | + |
| 130 | + - name: List all artifacts |
| 131 | + run: | |
| 132 | + echo "=== macOS artifacts ===" |
| 133 | + ls -lah ./artifacts/macos/ |
| 134 | + echo "=== Windows artifacts ===" |
| 135 | + ls -lah ./artifacts/windows/ |
| 136 | +
|
| 137 | + - name: Create GitHub Release |
| 138 | + uses: softprops/action-gh-release@v1 |
| 139 | + with: |
| 140 | + tag_name: desktop-${{ steps.version.outputs.tag }} |
| 141 | + name: Desktop App ${{ steps.version.outputs.version }} |
| 142 | + draft: false |
| 143 | + prerelease: false |
| 144 | + files: | |
| 145 | + ./artifacts/macos/* |
| 146 | + ./artifacts/windows/* |
| 147 | + body: | |
| 148 | + ## Kortix Desktop App ${{ steps.version.outputs.version }} |
| 149 | + |
| 150 | + ### Downloads |
| 151 | + |
| 152 | + - **macOS**: Download the `.dmg` file |
| 153 | + - **Windows**: Download the `.exe` file |
| 154 | + |
| 155 | + ### Installation |
| 156 | + |
| 157 | + **macOS:** |
| 158 | + 1. Download and open the `.dmg` file |
| 159 | + 2. Drag Kortix to your Applications folder |
| 160 | + 3. Open Kortix from Applications |
| 161 | + |
| 162 | + **Windows:** |
| 163 | + 1. Download and run the `.exe` installer |
| 164 | + 2. Follow the installation wizard |
| 165 | + 3. Launch Kortix from the Start Menu |
| 166 | + |
| 167 | + --- |
| 168 | + |
| 169 | + Built from commit: ${{ github.sha }} |
| 170 | + env: |
| 171 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 172 | + |
| 173 | + notify: |
| 174 | + needs: [build-macos, build-windows] |
| 175 | + runs-on: ubuntu-latest |
| 176 | + if: always() |
| 177 | + steps: |
| 178 | + - name: Build Status |
| 179 | + run: | |
| 180 | + if [ "${{ needs.build-macos.result }}" == "success" ] && [ "${{ needs.build-windows.result }}" == "success" ]; then |
| 181 | + echo "✅ All desktop builds completed successfully!" |
| 182 | + else |
| 183 | + echo "❌ Some builds failed:" |
| 184 | + echo " macOS: ${{ needs.build-macos.result }}" |
| 185 | + echo " Windows: ${{ needs.build-windows.result }}" |
| 186 | + exit 1 |
| 187 | + fi |
0 commit comments