-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (75 loc) · 2.51 KB
/
build-wpf-app.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
88
89
name: Build and Release NWN Log Rotator
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: windows-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Visual Studio for .NET Framework
- name: Setup Visual Studio
uses: microsoft/setup-msbuild@v1
# Step 3: Install NuGet
- name: Install NuGet
uses: NuGet/setup-nuget@v1
# Step 4: Restore NuGet packages
- name: Restore NuGet packages
run: nuget restore NWNLogRotator.sln
# Step 5: Build the solution for x64
- name: Build solution (x64)
run: msbuild NWNLogRotator.sln /p:Configuration=Release /p:Platform="x64"
# Step 6: Archive x64 binaries as build artifacts
- name: Archive x64 Release binaries
uses: actions/upload-artifact@v3
with:
name: Release-build-x64
path: |
NWNLogRotator\bin\Release\
# Step 7: Build the solution for x86
- name: Build solution (x86)
run: msbuild NWNLogRotator.sln /p:Configuration=Release /p:Platform="x86"
# Step 8: Archive x86 binaries as build artifacts
- name: Archive x86 Release binaries
uses: actions/upload-artifact@v3
with:
name: Release-build-x86
path: |
NWNLogRotator\bin\Release\
release:
needs: build
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Determine the next semantic version tag
- name: Calculate next version
id: next_version
uses: actions/github-script@v6
with:
script: |
const semver = require('semver');
const tags = await github.repos.listTags({
owner: context.repo.owner,
repo: context.repo.repo,
});
const latestTag = tags.data.length > 0 ? tags.data[0].name : '0.0.0';
const nextVersion = semver.inc(latestTag, 'patch');
core.setOutput('next_version', nextVersion);
result-encoding: string
# Step 3: Create a GitHub release with both x86 and x64 binaries
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.next_version.outputs.next_version }}
name: Release v${{ steps.next_version.outputs.next_version }}
files: |
NWNLogRotator/bin/Release/*.exe
body: |
## Changes
- Auto-generated release with both x86 and x64 binaries.