ci: Add GitHub Actions workflow for build and release #67
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: | |
| # ЭТАП 1: СБОРКА АРТЕФАКТОВ | |
| build: | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| version_type: [lite, intellect] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: List files for debugging | |
| run: ls -R | |
| - 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 | |
| if: matrix.version_type == 'intellect' | |
| 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 | |
| if: matrix.version_type == 'intellect' | |
| run: python ./build_analytics.py | |
| - name: List built analytics files (for debugging) | |
| if: matrix.version_type == 'intellect' | |
| run: ls -R extra/analytics | |
| - name: Build and package Electron app | |
| run: npm run dist:${{ matrix.version_type }} -- --${{ matrix.os == 'windows-latest' && 'win' || 'linux' }} --publish never | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.version_type }}-build | |
| path: dist/ | |
| # ЭТАП 2: СОЗДАНИЕ РЕЛИЗА | |
| create_release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| - name: List downloaded files (before cleanup) | |
| run: ls -R artifacts/ | |
| - name: Prepare release assets | |
| run: | | |
| mkdir release_assets | |
| find artifacts \( -name '*Setup*.exe' -o -name '*Portable*.exe' -o -name '*.AppImage' -o -name 'latest*.yml' \) -exec cp {} release_assets/ \; | |
| - name: List final release assets (after cleanup) | |
| run: ls -R release_assets/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| release_assets/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |