ci: Add GitHub Actions workflow for build and release #46
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+*' | |
| jobs: | |
| release: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Check out git repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # --- [БЛОК 1] Сборка исполняемого файла аналитики --- | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python dependencies | |
| run: pip install -r python_requirements.txt | |
| # ИЗМЕНЕННАЯ КОМАНДА СБОРКИ: без cd, прямой вызов .spec файла | |
| - name: Build analytics executable | |
| run: pyinstaller python_src/analytics.spec --distpath extra/analytics --workpath build_pyinstaller | |
| # --- [БЛОК 2] Сборка Electron-приложения --- | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libfuse2 | |
| - name: Build and release for Linux | |
| if: runner.os == 'Linux' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: | | |
| FUSE_PATH=$(readlink -f /usr/lib/x86_64-linux-gnu/libfuse.so.2) | |
| echo "FUSE library found at: $FUSE_PATH" | |
| EXTRA_FILES_CONFIG='[{"from": "'"$FUSE_PATH"'", "to": "lib/libfuse.so.2"}]' | |
| npm run dist -- --publish always --config.linux.extraFiles="$EXTRA_FILES_CONFIG" | |
| - name: Build and release for Windows | |
| if: runner.os == 'Windows' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: npm run dist -- --publish always |