-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
71 lines (58 loc) · 2.03 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
name: CI
on:
push:
branches:
- '**'
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-and-test:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore RunDialog.slnx
- name: Build solution
run: dotnet build RunDialog.slnx --configuration Release --no-restore
- name: Run tests
run: dotnet test RunDialog.Tests/RunDialog.Tests.csproj --configuration Release --no-build
release:
needs: build-and-test
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event_name == 'workflow_dispatch'
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Publish app for win-x64
run: |
dotnet publish RunDialog.App/RunDialog.App.csproj `
-c Release `
-r win-x64 `
--self-contained true `
-p:PublishReadyToRun=true `
-p:PublishTrimmed=true `
-o ./publish/win-x64
- name: Create ZIP archive
run: |
Compress-Archive -Path "./publish/win-x64/*" `
-DestinationPath "./RunDialog-${{ github.ref_name || github.run_id }}-win-x64.zip"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('manual-build-{0}', github.run_number) }}
name: ${{ github.ref_type == 'tag' && github.ref_name || format('RunDialog-manual-build-{0}', github.run_number) }}
files: ./RunDialog-${{ github.ref_name || github.run_id }}-win-x64.zip
generate_release_notes: ${{ github.ref_type == 'tag' }}