ci(win): pin release build to windows-2022 (#847) #30
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag for release (e.g., v1.0.0)' | |
| required: true | |
| default: v4.0.0 | |
| jobs: | |
| build: | |
| name: Build for ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| strategy: | |
| matrix: | |
| include: | |
| # Обе архитектуры macOS собираются одной джобой: раздельные джобы | |
| # затирали latest-mac.yml друг друга, ломая автообновление. | |
| - os: macos-15 | |
| platform: mac | |
| # Закреплено на windows-2022 (VS 2022): на windows-latest приехал | |
| # VS 2026 (v18), который приколоченный форк @electron/node-gyp не | |
| # распознаёт ("version undefined") и падает при rebuild нативных | |
| # модулей. Снять после апдейта electron-rebuild/node-gyp. | |
| - os: windows-2022 | |
| platform: win | |
| - os: ubuntu-latest | |
| platform: linux | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.29.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.14.1 | |
| cache: pnpm | |
| # node-gyp внутри electron-builder требует Python с distutils (< 3.12) | |
| # для кросс-архитектурной пересборки нативных модулей. | |
| - name: Setup Python for node-gyp (macOS) | |
| if: matrix.platform == 'mac' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Rebuild native dependencies | |
| run: pnpm run rebuild | |
| - name: Build application (macOS) | |
| if: matrix.platform == 'mac' | |
| run: pnpm run build:mac | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_LINK: ${{ secrets.CSC_LINK }} | |
| CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| - name: Build application (other platforms) | |
| if: matrix.platform != 'mac' | |
| run: pnpm run build:${{ matrix.platform }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: masscode-${{ matrix.platform }}-${{ github.ref_name || inputs.tag }} | |
| path: | | |
| dist/*.dmg | |
| dist/*.zip | |
| dist/*.pkg | |
| dist/*.exe | |
| dist/*.msi | |
| dist/*.AppImage | |
| dist/*.snap | |
| !dist/*.yml | |
| !dist/*.blockmap | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download artifacts from "build" job | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: masscode-* | |
| path: artifacts | |
| - name: Generate changelog | |
| run: npx changelogithub --output release-notes.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/**/* | |
| tag_name: ${{ github.ref_name || inputs.tag }} | |
| draft: true | |
| body_path: release-notes.md | |
| generate_release_notes: true | |
| append_body: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |