@@ -2,65 +2,73 @@ name: Release
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ schedule :
6
+ - cron : ' 0 9 * * *'
5
7
push :
6
8
tags :
7
9
- ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10
+
8
11
env :
9
12
solution : MaterialDesignToolkit.Full.sln
10
- buildPlatform : ' Any CPU'
11
13
buildConfiguration : ' Release'
12
14
mdixColorsVersion : ' 2.0.5'
13
15
mdixMahAppsVersion : ' 0.2.1'
14
16
mdixVersion : ' 4.4.0'
15
17
16
18
jobs :
17
- build :
19
+ check_for_changes :
18
20
if : ${{ github.repository == 'MaterialDesignInXAML/MaterialDesignInXamlToolkit' }}
19
21
runs-on : windows-latest
20
22
23
+ outputs :
24
+ has_changed : ${{ github.event_name == 'push' || steps.check_tag.outputs.has_changed }}
25
+
21
26
steps :
22
27
- uses : actions/checkout@v2
23
-
24
- - name : Setup .NET
25
- uses : actions/setup-dotnet@v1
28
+ if : ${{ github.event_name != 'push' }}
26
29
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
36
31
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"
39
40
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
42
44
43
- - name : Upload Screenshots
44
- if : ${{ always() }}
45
- uses : actions/upload-artifact@v2
45
+ steps :
46
+ - uses : actions/checkout@v2
46
47
with :
47
- name : Screenshots-${{ github.run_number }}
48
- path : ${{ github.workspace }}/MaterialDesignThemes.UITests/bin/${{ env.buildConfiguration }}/net5.0-windows/Screenshots
48
+ fetch-depth : 0
49
49
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
55
53
with :
56
- name : NuGets-${{ github.run_number }}
57
- path : " *.nupkg"
54
+ solution : ${{ env.solution }}
55
+ buildConfiguration : ${{ env.buildConfiguration }}
56
+ nugetKey : ${{ secrets.PAT }}
58
57
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 }}
64
67
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