-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (69 loc) · 2.17 KB
/
publish-version.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
name: Publish version
on:
push:
tags:
- v*
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-2022
dotnet:
- net6.0
- net461
exclude:
- os: ubuntu-latest
dotnet: net461
steps:
- uses: actions/checkout@v2
- name: Run dotnet test
run: dotnet test -c Release -f ${{ matrix.dotnet }}
release:
name: Release
runs-on: windows-2022
needs: [test]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install InheritDocTool
shell: powershell
run: dotnet tool install --global InheritDocTool
# GitVersion action doesn't support /ensureassemblyinfo, see https://github.com/GitTools/actions/issues/220
# So we need to create a new file to let GitVersion populate it
- name: Create assembly info file for GitVersion
shell: powershell
run: |
set-Content -Path Gw2Sharp/Properties/AssemblyVersionInfo.cs -Value 'using System.Reflection;'
- uses: gittools/actions/gitversion/setup@v0.9.11
with:
versionSpec: '5.x'
- uses: gittools/actions/gitversion/execute@v0.9.11
id: gitversion
with:
updateAssemblyInfo: true
updateAssemblyInfoFilename: Gw2Sharp/Properties/AssemblyVersionInfo.cs
- name: Run dotnet build
run: dotnet build -c Release -p:VERSIONED_BUILD=${{ steps.gitversion.outputs.semVer }}
- name: Run InheritDocTool
shell: powershell
run: InheritDoc -o
- name: Zip binaries
shell: powershell
run: 7z a Gw2Sharp.zip ./Gw2Sharp/bin/Release/*
- name: Run dotnet pack
run: dotnet pack Gw2Sharp -c Release --no-build --include-symbols -p:SymbolPackageFormat=snupkg -p:VERSIONED_BUILD=${{ steps.gitversion.outputs.semVer }} -o pack
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
Gw2Sharp.zip
pack/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}