feat: docker #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Desktop | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages/common/**' | |
| - 'packages/desktop/**' | |
| - 'package.json' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages/common/**' | |
| - 'packages/desktop/**' | |
| - 'package.json' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [macos-latest, windows-latest, ubuntu-22.04] | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json', '**/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm- | |
| - name: Cache Next.js | |
| uses: actions/cache@v4 | |
| with: | |
| path: packages/desktop/.next/cache | |
| key: ${{ runner.os }}-nextjs-desktop-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('packages/**/*.ts', 'packages/**/*.tsx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-desktop- | |
| - name: Cache electron-builder | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/Library/Caches/electron | |
| ~/Library/Caches/electron-builder | |
| ~/.cache/electron | |
| ~/.cache/electron-builder | |
| ~/AppData/Local/electron/Cache | |
| ~/AppData/Local/electron-builder/Cache | |
| key: ${{ runner.os }}-electron-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electron- | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Import Code-Signing Certificates (macOS) | |
| if: matrix.platform == 'macos-latest' && env.APPLE_CERTIFICATE != '' | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| uses: apple-actions/import-codesign-certs@v3 | |
| with: | |
| p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }} | |
| p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| - name: Install Linux dependencies | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rpm | |
| - name: Build Desktop app | |
| env: | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }} | |
| CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npm run package:${{ matrix.platform == 'macos-latest' && 'mac' || matrix.platform == 'windows-latest' && 'win' || 'linux' }} | |
| - name: Upload macOS DMG (arm64) | |
| if: matrix.platform == 'macos-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DPIP-macOS-arm64-dmg | |
| path: packages/desktop/dist/*-arm64.dmg | |
| - name: Upload macOS DMG (x64) | |
| if: matrix.platform == 'macos-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DPIP-macOS-x64-dmg | |
| path: packages/desktop/dist/*-x64.dmg | |
| - name: Upload Windows (x64) | |
| if: matrix.platform == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DPIP-Windows-x64 | |
| path: packages/desktop/dist/*-x64.exe | |
| - name: Upload Windows (ia32) | |
| if: matrix.platform == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DPIP-Windows-ia32 | |
| path: packages/desktop/dist/*-ia32.exe | |
| - name: Upload Linux (x64) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DPIP-Linux-x64 | |
| path: packages/desktop/dist/*-x64.AppImage | |
| - name: Upload Linux (arm64) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DPIP-Linux-arm64 | |
| path: packages/desktop/dist/*-arm64.AppImage |