-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (87 loc) · 3.52 KB
/
ci.yml
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
name: Continuous Integration
on: [push, pull_request]
jobs:
build:
name: Build (${{matrix.config}})
runs-on: windows-2022
strategy:
matrix:
config: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Fetch nuget packages
run: dotnet restore
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3
with:
vs-version: '[17.2,)'
- name: Build
id: build
run: |
msbuild OTDIPC.sln /p:Configuration="${{matrix.config}}"
$out = "${{runner.temp}}/out"
./copy-artifacts.ps1 `
-Configuration ${{matrix.config}} `
-Out $out `
-BuildNumber $Env:GITHUB_RUN_NUMBER
Add-Content $Env:GITHUB_OUTPUT "path=$out"
Add-Content $Env:GITHUB_OUTPUT "version=$(Get-Content $out/version.txt)"
- name: Attach zip
if: matrix.config != 'Debug'
uses: actions/upload-artifact@v4
with:
name: OpenKneeboard-OTD-IPC-v${{steps.build.outputs.version}}
path: ${{steps.build.outputs.path}}/OpenKneeboard-OTD-IPC.zip
- name: Attach test client
if: matrix.config != 'Debug'
uses: actions/upload-artifact@v4
with:
name: OpenKneeboard-OTD-IPC-TestClient-v${{steps.build.outputs.version}}
path: ${{steps.build.outputs.path}}/OTDIPC-TestClient.exe
- name: Attach debug symbols
if: matrix.config != 'Debug'
uses: actions/upload-artifact@v4
with:
name: OpenKneeboard-OTD-IPC-DebugSymbols-v${{steps.build.outputs.version}}
path: ${{steps.build.outputs.path}}/*.pdb
- name: Create draft release
id: create-release
if: github.ref_type == 'tag' && matrix.config != 'Debug'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: ${{github.ref_name}}
tag_name: ${{github.ref_name}}
draft: true
body: "Write release notes here"
- name: Attach zip to release
if: github.ref_type == 'tag' && matrix.config != 'Debug'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_name: OpenKneeboard-OTD-IPC-v${{steps.build.outputs.version}}.zip
asset_path: ${{steps.build.outputs.path}}/OpenKneeboard-OTD-IPC.zip
asset_content_type: application/zip
- name: Attach test client to release
if: github.ref_type == 'tag' && matrix.config != 'Debug'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_name: OpenKneeboard-OTD-IPC-TestClient-v${{steps.build.outputs.version}}.exe
asset_path: ${{steps.build.outputs.path}}/OTDIPC-TestClient.exe
asset_content_type: application/x-ms-download
- name: Attach debug symbols
if: github.ref_type == 'tag' && matrix.config != 'Debug'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_name: OpenKneeboard-OTD-IPC-DebugSymbols-v${{steps.build.outputs.version}}.zip
asset_path: ${{steps.build.outputs.path}}/DebugSymbols.zip
asset_content_type: application/zip