-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (64 loc) · 2.04 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
name: Publish version
on:
push:
tags:
- v*
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Run dotnet test
run: dotnet test -c Release
release:
name: Release
runs-on: windows-latest
needs: [test]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
# 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: |
mkdir DisposeGenerator/Properties
Set-Content -Path DisposeGenerator/Properties/AssemblyVersionInfo.cs -Value 'using System.Reflection;'
- uses: gittools/actions/gitversion/setup@v0.9.6
with:
versionSpec: '5.x'
- uses: gittools/actions/gitversion/execute@v0.9.6
id: gitversion
with:
updateAssemblyInfo: true
updateAssemblyInfoFilename: DisposeGenerator/Properties/AssemblyVersionInfo.cs
- name: Run dotnet build
run: dotnet build -c Release -p:VERSIONED_BUILD=${{ steps.gitversion.outputs.semVer }}
- name: Zip binaries
shell: powershell
run: 7z a DisposeGenerator.zip ./DisposeGenerator/bin/Release/*
- name: Run dotnet pack
run: dotnet pack DisposeGenerator -c Release --no-build -p:VERSIONED_BUILD=${{ steps.gitversion.outputs.semVer }} -o pack
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
DisposeGenerator.zip
pack/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}