Skip to content

Commit 54e3133

Browse files
committed
Adding release GH Action
1 parent 7d711c4 commit 54e3133

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
env:
9+
solution: MaterialDesignToolkit.Full.sln
10+
buildPlatform: 'Any CPU'
11+
buildConfiguration: 'Release'
12+
mdixColorsVersion: '2.0.3'
13+
mdixMahAppsVersion: '0.1.9'
14+
mdixVersion: '4.2.1'
15+
16+
jobs:
17+
build:
18+
runs-on: windows-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Setup .NET Core 3.1
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: "3.1.x"
27+
env:
28+
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
29+
30+
- name: Setup .NET 5
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: "5.x"
34+
env:
35+
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
36+
37+
- name: Restore dependencies
38+
run: dotnet restore ${{ env.solution }}
39+
40+
- name: Build
41+
run: dotnet build ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-restore -p:Platform="${{ env.buildPlatform }}" -p:MDIXVersion=${{ env.mdixVersion }}.${{ github.run_number }} -p:MDIXColorsVersion=${{ env.mdixColorsVersion }}.${{ github.run_number }} -p:MDIXMahAppsVersion=${{ env.mdixMahappsVersion }}.${{ github.run_number }} -p:TreatWarningsAsErrors=True
42+
43+
- name: Test
44+
run: dotnet test ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-build --verbosity detailed --blame-crash
45+
46+
- name: Upload Screenshots
47+
if: ${{ always() }}
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: Screenshots-${{ github.run_number }}
51+
path: ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ env.buildConfiguration }}/net5.0-windows/Screenshots
52+
53+
- name: Build NuGets
54+
run: .\Scripts\BuildNugets.ps1 -MDIXVersion ${{ env.mdixVersion }}-ci${{ github.run_number }} -MDIXMahAppsVersion ${{ env.mdixMahappsVersion }}-ci${{ github.run_number }} -MDIXColorsVersion ${{ env.mdixColorsVersion }}-ci${{ github.run_number }}
55+
56+
- name: Upload NuGets
57+
uses: actions/upload-artifact@v2
58+
with:
59+
name: NuGets-${{ github.run_number }}
60+
path: "*.nupkg"
61+
62+
- name: Upload Demo App
63+
uses: actions/upload-artifact@v2
64+
with:
65+
name: DemoApp-${{ github.run_number }}
66+
path: "MainDemo.Wpf/bin/${{ env.buildConfiguration }}"
67+
68+
- name: Publish to NuGet.org
69+
run: dotnet nuget push ${{ github.workspace }}\*.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.PAT }} --skip-duplicate

0 commit comments

Comments
 (0)