Enhance ResourceMonitorCard performance. #34
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: Build and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev/* | |
| - dev | |
| - feat/* | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| # Build Docker image (AMD64 only for testing) | |
| # ARM64 build is done only in release workflow to avoid QEMU slowness | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=sha,prefix={{branch}}- | |
| type=sha,format=short | |
| - name: Build and push Docker image (AMD64 only) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=amd64 | |
| cache-to: type=gha,mode=max,scope=amd64 | |
| provenance: false | |
| # Build macOS desktop app | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Wails CLI | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| cd frontend && npm ci | |
| - name: Download FFmpeg | |
| run: ./scripts/download-ffmpeg.sh darwin | |
| - name: Sync version | |
| run: bash scripts/sync-version.sh | |
| - name: Prepare build directory | |
| run: | | |
| mkdir -p build | |
| cp images/icon.png build/appicon.png | |
| - name: Build desktop app (macOS ARM64) | |
| run: ./scripts/build-desktop.sh release darwin/arm64 | |
| - name: Prepare artifact | |
| run: | | |
| cd build/bin | |
| zip -r ffforge-desktop-macos-arm64.zip ffforge-desktop.app | |
| - name: Upload macOS artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ffforge-desktop-macos-arm64 | |
| path: build/bin/ffforge-desktop-macos-arm64.zip | |
| retention-days: 30 | |
| # Build Windows desktop app | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Wails CLI | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| cd frontend | |
| npm ci | |
| - name: Download FFmpeg | |
| run: bash scripts/download-ffmpeg.sh windows | |
| shell: bash | |
| - name: Sync version | |
| run: bash scripts/sync-version.sh | |
| shell: bash | |
| - name: Prepare build directory | |
| run: | | |
| mkdir -p build | |
| cp images/icon.png build/appicon.png | |
| shell: bash | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| VITE_APP_VERSION=$(node -p "require('./package.json').version") npm run build | |
| shell: bash | |
| - name: Build desktop app (Windows AMD64) | |
| run: wails build -debug -platform windows/amd64 | |
| - name: Package Windows release with FFmpeg | |
| run: | | |
| mkdir -p release | |
| cp build/bin/ffforge-desktop.exe release/ | |
| if [ -f embed/ffmpeg/windows/ffmpeg.exe ]; then | |
| mkdir -p release/ffmpeg | |
| cp embed/ffmpeg/windows/ffmpeg.exe release/ffmpeg/ | |
| cp embed/ffmpeg/windows/ffprobe.exe release/ffmpeg/ | |
| echo "✓ FFmpeg included in package" | |
| else | |
| echo "⚠ FFmpeg not found, package will use system FFmpeg" | |
| fi | |
| cd release | |
| 7z a -tzip ffforge-desktop-windows-amd64.zip * | |
| shell: bash | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ffforge-desktop-windows-amd64 | |
| path: release/ffforge-desktop-windows-amd64.zip | |
| retention-days: 30 | |
| # Summary job to check overall status | |
| build-summary: | |
| needs: [build-docker, build-macos, build-windows] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check build status | |
| run: | | |
| echo "Docker build: ${{ needs.build-docker.result }}" | |
| echo "macOS build: ${{ needs.build-macos.result }}" | |
| echo "Windows build: ${{ needs.build-windows.result }}" | |
| if [ "${{ needs.build-docker.result }}" != "success" ] || \ | |
| [ "${{ needs.build-macos.result }}" != "success" ] || \ | |
| [ "${{ needs.build-windows.result }}" != "success" ]; then | |
| echo "One or more builds failed" | |
| exit 1 | |
| fi | |
| echo "All builds completed successfully!" | |
| echo "" | |
| echo "📦 Artifacts are available in the Actions tab" | |
| echo "🐳 Docker images are pushed to ghcr.io/${{ github.repository }}" | |