This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
84 lines (70 loc) · 2.62 KB
/
main.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
name: MSBuild
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
configuration: [Debug, Release]
# For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: windows-latest
env:
Solution_Name: HyperV.NET.sln
steps:
- name: Checkout
uses: actions/checkout@v2
# https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
# https://github.com/marketplace/actions/assemblyinfo-version
- name: Get AssemblyInfo version
id: get_assemblyinfo_version
uses: jasondavis303/assembly-info-version@v1.0.1
with:
# File path of AssemblyInfo, relative to the root of the repository
AI_PATH: HyperV.NET/Properties/AssemblyInfo.cs
# https://github.com/marketplace/actions/bump-semantic-version
- name: Increment version
id: increment_version
uses: jessicalostinspace/bump-semantic-version-action@v1.0.1
with:
# A semantic version you want to increase
semantic-version: ${{ steps.get_assemblyinfo_version.outputs.ASSEMBLY_VERSION }}
# MAJOR, MINOR, or PATCH
version-type: PATCH
- name: Print version
run: echo "${{ steps.increment_version.outputs.bumped-semantic-version }}"
# https://github.com/marketplace/actions/file-regex-replace
- name: Update AsesmblyInfo version
uses: mingjun97/file-regex-replace@v1
with:
# regex to apply (regex)
regex: '\d+\.\d+\.\d+\.\d+'
# flags of the regex
flags: g
# replacement string
replacement: '${{ steps.increment_version.outputs.bumped-semantic-version }}.0'
# Files to be replaced (regex)
include: 'AssemblyInfo.cs'
# Files not to be replaced (regex)
exclude: '.^'
# String file encoding
encoding: 'utf8'
# Path to the folder to be replaced
path: 'HyperV.NET\Properties'
- name: Build the application
run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# https://github.com/marketplace/actions/upload-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: HyperV.NET_v${{ steps.increment_version.outputs.bumped-semantic-version }}.0_${{ env.Configuration }}
path: .\HyperV.NET\bin\${{ env.Configuration }}
env:
Configuration: ${{ matrix.configuration }}