Skip to content

Commit 0bc05f1

Browse files
committed
Updating github action yamls
1 parent 4bba83e commit 0bc05f1

File tree

6 files changed

+130
-157
lines changed

6 files changed

+130
-157
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Compile and Test'
2+
description: 'Build the solution and runs the tests'
3+
inputs:
4+
solution:
5+
description: 'The relative path to the solution file'
6+
required: true
7+
buildConfiguration:
8+
description: 'The configuration to use when building'
9+
required: true
10+
nugetKey:
11+
description: The API key to setup with the NUGET_AUTH_TOKEN.
12+
required: false
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: |
20+
3.1.x
21+
5.x
22+
6.x
23+
env:
24+
NUGET_AUTH_TOKEN: ${{ inputs.nugetToken }}
25+
26+
- name: Restore dependencies
27+
run: dotnet restore ${{ inputs.solution }}
28+
29+
- name: Build
30+
run: dotnet build ${{ inputs.solution }} --configuration ${{ inputs.buildConfiguration }} --no-restore -p:Platform="Any CPU" -p:TreatWarningsAsErrors=True
31+
32+
- name: Test
33+
run: dotnet test ${{ inputs.solution }} --configuration ${{ inputs.buildConfiguration }} --no-build --verbosity detailed --blame-crash
34+
35+
- name: Upload Screenshots
36+
if: ${{ always() }}
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: Screenshots-${{ github.run_number }}
40+
path: ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ inputs.buildConfiguration }}/net5.0-windows/Screenshots
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Compile and Test'
2+
description: 'Build the solution and runs the tests'
3+
inputs:
4+
mdixVersion:
5+
description: 'The version number for the Matrial Design in XAML library'
6+
required: true
7+
mdixColorsVersion:
8+
description: 'The version number for the Matrial Design Colors library'
9+
required: true
10+
mdixMahAppsVersion:
11+
description: 'The version number for the Matrial Design MahApps library'
12+
required: true
13+
demoAppPath:
14+
description: 'The relative path to the compiled version of the demo app'
15+
required: true
16+
nugetKey:
17+
description: 'The NuGet API key'
18+
required: true
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Build NuGets
23+
run: .\Scripts\BuildNugets.ps1 -MDIXVersion ${{ inputs.mdixVersion }} -MDIXMahAppsVersion ${{ inputs.mdixMahAppsVersion }} -MDIXColorsVersion ${{ inputs.mdixColorsVersion }}
24+
25+
- name: Upload NuGets
26+
uses: actions/upload-artifact@v2
27+
with:
28+
name: NuGets-${{ github.run_number }}
29+
path: "*.nupkg"
30+
31+
- name: Upload Demo App
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: DemoApp-${{ github.run_number }}
35+
path: "${{ inputs.demoAppPath }}"
36+
37+
- name: Publish to NuGet.org
38+
run: dotnet nuget push ${{ github.workspace }}\*.nupkg --source https://api.nuget.org/v3/index.json -k ${{ inputs.nugetKey }} --skip-duplicate

.github/workflows/icon_update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup .NET
1818
uses: actions/setup-dotnet@v1
1919
with:
20-
dotnet-version: 3.1.x
20+
dotnet-version: 6.x
2121

2222
- name: Run Icon Generation
2323
run: dotnet run -c Release -- icons

.github/workflows/nightly_release.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

.github/workflows/pr_verification.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
env:
1010
solution: MaterialDesignToolkit.Full.sln
11-
buildPlatform: 'Any CPU'
1211
buildConfiguration: 'Release'
1312

1413
jobs:
@@ -19,28 +18,10 @@ jobs:
1918
steps:
2019
- uses: actions/checkout@v2
2120

22-
- name: Setup .NET
23-
uses: actions/setup-dotnet@v1
21+
- name: Build and Test
22+
uses: ./.github/actions/build-and-test
23+
timeout-minutes: 20
2424
with:
25-
dotnet-version: |
26-
3.1.x
27-
5.x
28-
6.x
29-
env:
30-
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
31-
32-
- name: Restore dependencies
33-
run: dotnet restore ${{ env.solution }}
34-
35-
- name: Build
36-
run: dotnet build ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-restore -p:Platform="${{ env.buildPlatform }}" -p:TreatWarningsAsErrors=True
37-
38-
- name: Test
39-
run: dotnet test ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-build --verbosity detailed --blame-crash
40-
41-
- name: Upload Screenshots
42-
if: ${{ always() }}
43-
uses: actions/upload-artifact@v2
44-
with:
45-
name: Screenshots-${{ github.run_number }}
46-
path: ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ env.buildConfiguration }}/net5.0-windows/Screenshots
25+
solution: ${{ env.solution }}
26+
buildConfiguration: ${{ env.buildConfiguration }}
27+
nugetKey: ${{ secrets.PAT }}

.github/workflows/release.yml

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,73 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
schedule:
6+
- cron: '0 9 * * *'
57
push:
68
tags:
79
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10+
811
env:
912
solution: MaterialDesignToolkit.Full.sln
10-
buildPlatform: 'Any CPU'
1113
buildConfiguration: 'Release'
1214
mdixColorsVersion: '2.0.5'
1315
mdixMahAppsVersion: '0.2.1'
1416
mdixVersion: '4.4.0'
1517

1618
jobs:
17-
build:
19+
check_for_changes:
1820
if: ${{ github.repository == 'MaterialDesignInXAML/MaterialDesignInXamlToolkit' }}
1921
runs-on: windows-latest
2022

23+
outputs:
24+
has_changed: ${{ github.event_name == 'push' || steps.check_tag.outputs.has_changed }}
25+
2126
steps:
2227
- uses: actions/checkout@v2
23-
24-
- name: Setup .NET
25-
uses: actions/setup-dotnet@v1
28+
if: ${{ github.event_name != 'push' }}
2629
with:
27-
dotnet-version: |
28-
3.1.x
29-
5.x
30-
6.x
31-
env:
32-
NUGET_AUTH_TOKEN: ${{secrets.PAT}}
33-
34-
- name: Restore dependencies
35-
run: dotnet restore ${{ env.solution }}
30+
fetch-depth: 0
3631

37-
- name: Build
38-
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
32+
- id: check_tag
33+
name: Check nightly_release tag
34+
if: ${{ github.event_name != 'push' }}
35+
run: |
36+
$nightlyReleaseHash = $(git rev-parse nightly_release)
37+
$masterHash = $(git rev-parse master)
38+
$hasChanged = ($nightlyReleaseHash -ne $masterHash).ToString().ToLower()
39+
echo "::set-output name=has_changed::$hasChanged"
3940
40-
- name: Test
41-
run: dotnet test ${{ env.solution }} --configuration ${{ env.buildConfiguration }} --no-build --verbosity detailed --blame-crash
41+
build:
42+
needs: [check_for_changes]
43+
runs-on: windows-latest
4244

43-
- name: Upload Screenshots
44-
if: ${{ always() }}
45-
uses: actions/upload-artifact@v2
45+
steps:
46+
- uses: actions/checkout@v2
4647
with:
47-
name: Screenshots-${{ github.run_number }}
48-
path: ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ env.buildConfiguration }}/net5.0-windows/Screenshots
48+
fetch-depth: 0
4949

50-
- name: Build NuGets
51-
run: .\Scripts\BuildNugets.ps1 -MDIXVersion ${{ env.mdixVersion }} -MDIXMahAppsVersion ${{ env.mdixMahappsVersion }} -MDIXColorsVersion ${{ env.mdixColorsVersion }}
52-
53-
- name: Upload NuGets
54-
uses: actions/upload-artifact@v2
50+
- name: Build and Test
51+
uses: ./.github/actions/build-and-test
52+
timeout-minutes: 20
5553
with:
56-
name: NuGets-${{ github.run_number }}
57-
path: "*.nupkg"
54+
solution: ${{ env.solution }}
55+
buildConfiguration: ${{ env.buildConfiguration }}
56+
nugetKey: ${{ secrets.PAT }}
5857

59-
- name: Upload Demo App
60-
uses: actions/upload-artifact@v2
61-
with:
62-
name: DemoApp-${{ github.run_number }}
63-
path: "MainDemo.Wpf/bin/${{ env.buildConfiguration }}"
58+
# - name: Push Artifacts
59+
# uses: ./.github/actions/push-artifacts
60+
# timeout-minutes: 10
61+
# with:
62+
# mdixVersion: ${{ env.mdixVersion }}-ci${{ github.run_number }}
63+
# mdixColorsVersion: ${{ env.mdixColorsVersion }}-ci${{ github.run_number }}
64+
# mdixMahAppsVersion: ${{ env.mdixMahappsVersion }}-ci${{ github.run_number }}
65+
# demoAppPath: "MainDemo.Wpf/bin/${{ env.buildConfiguration }}"
66+
# nugetKey: ${{ secrets.PAT }}
6467

65-
- name: Publish to NuGet.org
66-
run: dotnet nuget push ${{ github.workspace }}\*.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.PAT }} --skip-duplicate
68+
- name: Update latest tag
69+
if: ${{ github.event_name != 'push' }}
70+
run: |
71+
git config user.name github-actions
72+
git config user.email [email protected]
73+
git tag -f nightly_release master
74+
git push -f --tags

0 commit comments

Comments
 (0)