Skip to content

Commit 6b12861

Browse files
committed
ci: Add GitHub Actions workflow for build and release
1 parent 2848df7 commit 6b12861

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- 'v*.*.*'
99

1010
jobs:
11-
# --- ЭТАП 1: СБОРКА АРТЕФАКТОВ ---
12-
build: # Переименовали 'release' в 'build' для ясности
11+
# ЭТАП 1: СБОРКА АРТЕФАКТОВ
12+
build:
1313
strategy:
1414
matrix:
1515
os: [windows-latest, ubuntu-latest]
@@ -54,11 +54,9 @@ jobs:
5454
if: matrix.version_type == 'intellect'
5555
run: ls -R extra/analytics
5656

57-
# --- ИЗМЕНЕНИЕ: Убираем публикацию и добавляем флаг --publish never ---
5857
- name: Build and package Electron app
5958
run: npm run dist:${{ matrix.version_type }} -- --${{ matrix.os == 'windows-latest' && 'win' || 'linux' }} --publish never
6059
env:
61-
# Токен больше не нужен на этом этапе, но оставим на всякий случай
6260
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
6361

6462
- name: Upload artifact
@@ -67,9 +65,8 @@ jobs:
6765
name: ${{ matrix.os }}-${{ matrix.version_type }}-build
6866
path: dist/
6967

70-
# --- ЭТАП 2: СОЗДАНИЕ РЕЛИЗА ---
68+
# ЭТАП 2: СОЗДАНИЕ РЕЛИЗА
7169
create_release:
72-
# Зависит от успешного завершения ВСЕХ сборок
7370
needs: build
7471
runs-on: ubuntu-latest
7572

@@ -79,13 +76,33 @@ jobs:
7976
with:
8077
path: artifacts/
8178

82-
- name: List downloaded files (for debugging)
79+
- name: List downloaded files (before cleanup)
8380
run: ls -R artifacts/
8481

82+
- name: Clean up artifacts
83+
run: |
84+
# 1. Удаляем все ненужные .blockmap и debug файлы
85+
find artifacts -name "*.blockmap" -type f -delete
86+
find artifacts -name "builder-debug.yml" -type f -delete
87+
88+
# 2. Обрабатываем файлы для автообновления
89+
# Нам нужен только один latest.yml для Windows и один latest-linux.yml для Linux.
90+
# Берем их из Intellect-версии, так как она основная.
91+
# Сначала удаляем все, кроме тех, что от Intellect
92+
find artifacts -name "latest.yml" ! -path "*intellect*" -type f -delete
93+
find artifacts -name "latest-linux.yml" ! -path "*intellect*" -type f -delete
94+
95+
# 3. Перемещаем все оставшиеся файлы в одну общую папку для удобства
96+
mkdir release_files
97+
find artifacts -type f -print -exec mv {} release_files/ \;
98+
99+
- name: List cleaned files (after cleanup)
100+
run: ls -R release_files/
101+
85102
- name: Create GitHub Release
86103
uses: softprops/action-gh-release@v2
87104
with:
88105
files: |
89-
artifacts/*/*
106+
release_files/*
90107
env:
91108
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)