-
-
Notifications
You must be signed in to change notification settings - Fork 257
132 lines (116 loc) · 3.93 KB
/
Copy pathrelease.yml
File metadata and controls
132 lines (116 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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 }}