-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (80 loc) · 3.09 KB
/
release.yml
File metadata and controls
97 lines (80 loc) · 3.09 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
name: Release
on:
push:
tags:
- 'v*' # теги вида v1.0.0, v2.1.3 и т.д.
permissions:
contents: write # для создания релиза и загрузки артефактов
jobs:
build:
name: ${{ matrix.name }} / Release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows MSVC
config: Release
cmake_args: ""
artifact_name: gwbasic.exe
asset_name: gwbasic-windows-amd64.exe
- os: ubuntu-latest
name: Linux GCC
config: Release
cmake_args: "-DCMAKE_CXX_COMPILER=g++"
artifact_name: gwbasic
asset_name: gwbasic-linux-amd64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++ libx11-dev libgl1-mesa-dev
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} ${{ matrix.cmake_args }}
- name: Build
run: cmake --build build --config ${{ matrix.config }} --parallel
# Определяем правильный путь к исполняемому файлу
- name: Set artifact path (Windows)
if: runner.os == 'Windows'
run: echo "artifact_path=build/${{ matrix.config }}/${{ matrix.artifact_name }}" >> $env:GITHUB_ENV
- name: Set artifact path (Linux)
if: runner.os == 'Linux'
run: echo "artifact_path=build/${{ matrix.artifact_name }}" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ env.artifact_path }}
release:
name: Create Release and Upload Assets
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List downloaded files
run: ls -la artifacts/*
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body: |
## Автоматический релиз для ${{ github.ref_name }}
### Сборки
- **Windows** (MSVC, 64-bit) – `gwbasic-windows-amd64.exe`
- **Linux** (GCC, 64-bit) – `gwbasic-linux-amd64`
### Установка
- **Windows**: запустите `.exe` файл из командной строки или PowerShell.
- **Linux**: дайте права на выполнение `chmod +x gwbasic-linux-amd64` и запустите `./gwbasic-linux-amd64`.
### Изменения
Полный список изменений смотрите в [CHANGELOG.md](CHANGELOG.md) или через `git log`.
draft: false
prerelease: false
files: |
artifacts/**/*