fix: action #1
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: | |
| include: | |
| - platform: macos-latest | |
| build_script: package:mac | |
| - platform: windows-latest | |
| build_script: package:win | |
| - platform: ubuntu-22.04 | |
| build_script: package:linux | |
| 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: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.bun/install/cache | |
| node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb', '**/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Cache Next.js | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/desktop/.next/cache | |
| key: ${{ runner.os }}-nextjs-desktop-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('packages/**/*.ts', 'packages/**/*.tsx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-desktop- | |
| - name: Cache Webpack | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/desktop/build | |
| packages/desktop/.erb | |
| key: ${{ runner.os }}-webpack-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('packages/desktop/electron/**/*.ts') }} | |
| restore-keys: | | |
| ${{ runner.os }}-webpack- | |
| - 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('**/bun.lockb') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electron- | |
| - name: Install dependencies | |
| run: bun 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: bun run ${{ matrix.build_script }} | |
| - name: Upload artifacts (macOS) | |
| if: matrix.platform == 'macos-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-app | |
| path: | | |
| packages/desktop/dist/*.dmg | |
| packages/desktop/dist/*.zip | |
| packages/desktop/dist/*.blockmap | |
| - name: Upload artifacts (Windows) | |
| if: matrix.platform == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-app | |
| path: | | |
| packages/desktop/dist/*.exe | |
| packages/desktop/dist/*.blockmap | |
| - name: Upload artifacts (Linux) | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-app | |
| path: | | |
| packages/desktop/dist/*.AppImage | |
| packages/desktop/dist/*.blockmap |