Skip to content

Commit b4fd92c

Browse files
committed
feat: update dotnet-desktop.yml for multi-platform support and enhance build process
1 parent b993e93 commit b4fd92c

2 files changed

Lines changed: 33 additions & 11 deletions

File tree

.github/workflows/dotnet-desktop.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
1110
build:
12-
1311
strategy:
1412
matrix:
1513
configuration: [Release]
16-
runs-on: windows-latest
14+
os: [windows-latest, macos-latest]
15+
include:
16+
- os: windows-latest
17+
platform: win-x64
18+
- os: macos-latest
19+
platform: osx-arm64
20+
21+
runs-on: ${{ matrix.os }}
1722

1823
env:
1924
Solution_Name: vector-editor.sln # Actual solution name
@@ -28,20 +33,37 @@ jobs:
2833
- name: Install .NET Core
2934
uses: actions/setup-dotnet@v4
3035
with:
31-
dotnet-version: 8.0.x
36+
dotnet-version: 9.0.x
3237

33-
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
38+
# Add MSBuild to the PATH (Windows only)
3439
- name: Setup MSBuild.exe
3540
uses: microsoft/setup-msbuild@v2
41+
if: matrix.os == 'windows-latest'
3642

3743
# Build the application
3844
- name: Build the application
39-
run: dotnet build $env:Solution_Name --configuration $env:Configuration
40-
env:
41-
Configuration: ${{ matrix.configuration }}
45+
shell: bash
46+
run: |
47+
if [ "${{ matrix.os }}" == "windows-latest" ]; then
48+
dotnet build $Solution_Name --configuration ${{ matrix.configuration }}
49+
else
50+
dotnet build $Solution_Name --configuration ${{ matrix.configuration }}
51+
fi
52+
53+
# Publish the application for specific runtime
54+
- name: Publish the application
55+
shell: bash
56+
run: |
57+
dotnet publish $Solution_Name \
58+
--configuration ${{ matrix.configuration }} \
59+
--runtime ${{ matrix.platform }} \
60+
--self-contained true \
61+
-p:PublishSingleFile=true \
62+
-p:PublishTrimmed=true \
63+
-o publish/${{ matrix.platform }}
4264
4365
- name: Upload build artifacts
4466
uses: actions/upload-artifact@v4
4567
with:
46-
name: Build Output
47-
path: bin/${{ matrix.configuration }}
68+
name: vector-editor-${{ matrix.platform }}
69+
path: publish/${{ matrix.platform }}

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
- [x] Сохранение файлов
2222
- [x] Экспорт файлов
2323
- [x] Экспорт svg
24-
- [ ] Автосборка
24+
- [x] Автосборка

0 commit comments

Comments
 (0)