Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit f853c87

Browse files
committed
Prepare worflow for Release
1 parent fcb8247 commit f853c87

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/release.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- 'Src/**'
8+
jobs:
9+
build-extension:
10+
runs-on: windows-latest
11+
env:
12+
DOTNET_NOLOGO: true
13+
DOTNET_CLI_TELEMETRY_OPTOUT: true
14+
RepositoryUrl: 'https://github.com/${{ github.repository }}'
15+
RepositoryBranch: '${{ github.ref }}'
16+
SourceRevisionId: '${{ github.sha }}'
17+
Configuration: Release
18+
SolutionPath: Src\Tellurium.sln
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
- name: Setup .NET Core
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: '2.0.x'
26+
- name: Setup MSBuild.exe
27+
uses: microsoft/setup-msbuild@v1.0.2
28+
- name: Restore NuGet Packages
29+
run: nuget restore $env:SolutionPath
30+
- name: Calculate next version
31+
uses: cezarypiatek/NextVersionGeneratorAction@0.4
32+
with:
33+
minor-pattern: '\bAdd\b'
34+
patch-pattern: '.*'
35+
output-to-env-variable: 'Version'
36+
- name: Build solution
37+
run: msbuild $env:SolutionPath /t:Rebuild
38+
- name: Generate nuget packages
39+
run: |
40+
nuget pack Src\MvcPages\MvcPages.csproj.nuspec -NoPackageAnalysis -verbosity detailed -OutputDirectory ./dist -Version $env:Version -Properties Configuration=$env:Configuration
41+
nuget pack Src\VisualAssertions\VisualAssertions.csproj.nuspec -NoPackageAnalysis -verbosity detailed -OutputDirectory ./dist -Version $env:Version -Properties Configuration=$env:Configuration
42+
- name: Generate release note
43+
run: |
44+
git fetch --prune --unshallow
45+
$commitLog = git log "$(git describe --tags --abbrev=0)..HEAD" --pretty=format:"- %s"
46+
"What's new: `r`n`r`n$([string]::Join("`r`n",$commitLog))" | Out-File release_note.md -Encoding utf8
47+
- name: Create Github Release
48+
id: create_release
49+
uses: actions/create-release@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tag_name: ${{ env.Version }}
54+
release_name: ${{ env.Version }}
55+
body_path: release_note.md
56+
draft: false
57+
prerelease: false
58+
- name: Upload Release Asset - Tellurium.MvcPages Nuget
59+
uses: actions/upload-release-asset@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
upload_url: ${{ steps.create_release.outputs.upload_url }}
64+
asset_path: ./dist/Tellurium.MvcPages.${{ env.Version }}.nupkg
65+
asset_name: Tellurium.MvcPages.${{ env.Version }}.nupkg
66+
asset_content_type: binary/octet-stream
67+
- name: Upload Release Asset - Tellurium.VisualAssertions Nuget
68+
uses: actions/upload-release-asset@v1
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
with:
72+
upload_url: ${{ steps.create_release.outputs.upload_url }}
73+
asset_path: ./dist/Tellurium.VisualAssertions.${{ env.Version }}.nupkg
74+
asset_name: Tellurium.VisualAssertions.${{ env.Version }}.nupkg
75+
asset_content_type: binary/octet-stream
76+
- name: Publish extension to Nuget
77+
run: |
78+
dotnet nuget push ./dist/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)