ci: Add GitHub Actions workflow for build and release #59
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
| # .github/workflows/release.yml | |
| name: Build & Release Cross-Platform | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Используем более гибкий триггер для тестов | |
| jobs: | |
| release: | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 # Тоже обновим на всякий случай | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libfuse2 | |
| - name: Build Python analytics executables | |
| run: python ./build_analytics.py | |
| - name: List built analytics files (for debugging) | |
| run: ls -R extra/analytics | |
| - name: Build and package Electron app | |
| run: npm run dist -- --${{ matrix.os == 'windows-latest' && 'win' || 'linux' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 # <--- ИСПРАВЛЕНИЕ 1 | |
| with: | |
| name: ${{ matrix.os }}-build | |
| path: dist/ | |
| create_release: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 # <--- ИСПРАВЛЕНИЕ 2 | |
| with: | |
| path: artifacts/ | |
| - name: List downloaded files (for debugging) | |
| run: ls -R artifacts/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 # Также обновим и этот action до последней версии | |
| with: | |
| files: | | |
| artifacts/windows-latest/* | |
| artifacts/ubuntu-latest/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |