Feat/git sync watch #464
Workflow file for this run
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: Release App | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| paths-ignore: | |
| - "README.md" | |
| - "docs/**" | |
| - ".vscode" | |
| pull_request: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "docs/**" | |
| - "README.md" | |
| - ".vscode" | |
| concurrency: | |
| group: release-ci-group | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/test.yml | |
| build: | |
| needs: test | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: arm64 | |
| - os: macos-latest | |
| platform: mac | |
| arch: x64 | |
| - os: macos-latest | |
| platform: mac | |
| arch: arm64 | |
| - os: windows-latest | |
| platform: win | |
| arch: x64 | |
| - os: windows-latest | |
| platform: win | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: lts/* | |
| # Windows specific: Set up CV dependency for pngquant-bin | |
| # Also sets up MSVC (Microsoft Visual C++) compiler for native modules (nsfw, better-sqlite3) | |
| - name: Set up CV dependency for pngquant-bin | |
| if: matrix.platform == 'win' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| # Install dependencies for x64 architectures | |
| - name: Install dependencies (x64) | |
| if: matrix.arch == 'x64' | |
| run: | | |
| ${{ matrix.platform == 'linux' && 'pnpm install && pnpm remove registry-js' || 'pnpm install' }} | |
| env: | |
| npm_config_arch: x64 | |
| # Install dependencies for arm64 architectures | |
| - name: Install dependencies (arm64) | |
| if: matrix.arch == 'arm64' | |
| run: pnpm install dugite --force | |
| env: | |
| npm_config_arch: ${{ matrix.platform == 'win' && 'ia32' || 'arm64' }} | |
| - name: Build plugins | |
| run: pnpm run build:plugin | |
| # Install C++ build tools for native modules (Linux only) | |
| # macOS: GitHub Actions runners come with Xcode Command Line Tools pre-installed | |
| # Windows: MSVC is set up by msvc-dev-cmd action above | |
| - name: Install build dependencies (Linux) | |
| if: matrix.platform == 'linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Rebuild native modules for Electron | |
| run: pnpm exec electron-rebuild -f -w better-sqlite3,nsfw | |
| - name: Make ${{ matrix.platform }} (${{ matrix.arch }}) | |
| run: | | |
| pnpm exec electron-forge make --platform=${{ matrix.platform == 'mac' && 'darwin' || matrix.platform == 'win' && 'win32' || 'linux' }} --arch=${{ matrix.arch }} | |
| env: | |
| NODE_ENV: production | |
| # macOS specific environment variables | |
| APPLE_ID: ${{ matrix.platform == 'mac' && secrets.APPLE_ID || '' }} | |
| APPLE_ID_PASSWORD: ${{ matrix.platform == 'mac' && secrets.APPLE_ID_PASSWORD || '' }} | |
| # Windows specific environment variables | |
| CSC_LINK: ${{ matrix.platform == 'win' && secrets.WIN_CERT || '' }} | |
| CSC_KEY_PASSWORD: ${{ matrix.platform == 'win' && secrets.WIN_CERT_PASS || '' }} | |
| # Common environment variables | |
| CI: true | |
| CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }} | |
| # Only need 1 set of analyzer reports (linux x64) | |
| ANALYZE: ${{ matrix.platform == 'linux' && matrix.arch == 'x64' }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Upload analyzer reports and packaged apps as workflow artifacts (only linux x64) | |
| - name: Upload analyzer reports | |
| if: matrix.platform == 'linux' && matrix.arch == 'x64' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: analyzer-reports-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| .vite/renderer/bundle-analyzer-renderer.html | |
| .vite/main/bundle-analyzer-main.html | |
| if-no-files-found: ignore | |
| - name: Upload packaged apps | |
| if: (matrix.platform == 'mac' && matrix.arch == 'x64') || (matrix.platform == 'win' && matrix.arch == 'x64') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packaged-apps-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: out/make/** | |
| if-no-files-found: ignore | |
| # Create Release (upload artifacts from all builds) | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| ${{ matrix.platform == 'win' && 'out/make/**/*.exe' || 'out/make/**/*' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Bundle analysis is handled by Vite configs when ANALYZE=true |