22 push :
33 branches :
44 - master
5+ - beta
56
67name : Create Release
78jobs :
@@ -13,55 +14,64 @@ jobs:
1314 - name : Checkout code
1415 uses : actions/checkout@v1
1516
16- - name : Bump version
17- id : version
18- uses :
anothrNick/[email protected] 19- env :
20- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
21- DRY_RUN : true
22-
2317 - name : Setup .NET Core
2418 uses : actions/setup-dotnet@v1
2519 with :
2620 dotnet-version : 3.1.x
2721
28- - name : Dotnet Pack
29- working-directory : src/BlazorTable
30- run : dotnet pack -c Release -p:Version=${{ steps.version.outputs.new_tag }}
31-
32- - name : Set Test Address
33- run : |
34- Set-Content -Path "src/BlazorTable.Tests/BrowserTestsAddress.config" -Value "https://blazortable.netlify.app";
35- shell : pwsh
36-
37- - name : Dotnet Test
38- run : dotnet test --configuration Release
39-
40- - name : Dotnet Nuget Push
41- if : " !contains(github.event.head_commit.message, '#skip')"
42- working-directory : src/BlazorTable/bin/Release
43- run : dotnet nuget push BlazorTable.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
44- continue-on-error : true
45-
4622 - name : Dotnet Publish
4723 working-directory : src/BlazorTable.Sample.Wasm
4824 run : dotnet publish -c Release
4925
5026 - name : Deploy to Production
27+ if : github.ref == 'refs/heads/master'
28+ id : netlify
5129 uses : netlify/actions/cli@master
5230 with :
5331 args : deploy --prod --json -d src/BlazorTable.Sample.Wasm/bin/Release/netstandard2.1/publish/wwwroot
5432 env :
5533 NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
5634 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
5735
58- - name : Create Release
59- if : " !contains(github.event.head_commit.message, '#skip')"
60- uses : actions/create-release@master
36+ - name : Set Test Address
37+ if : github.ref == 'refs/heads/master'
38+ run : |
39+ Set-Content -Path "src/BlazorTable.Tests/BrowserTestsAddress.config" -Value "${{ steps.netlify.outputs.NETLIFY_URL }}";
40+ shell : pwsh
41+
42+ - name : Deploy to Staging
43+ if : github.ref == 'refs/heads/beta'
44+ id : netlify2
45+ uses : netlify/actions/cli@master
46+ with :
47+ args : deploy --json -d src/BlazorTable.Sample.Wasm/bin/Release/netstandard2.1/publish/wwwroot
6148 env :
62- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
50+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
51+
52+ - name : Set Test Address
53+ if : github.ref == 'refs/heads/beta'
54+ run : |
55+ Set-Content -Path "src/BlazorTable.Tests/BrowserTestsAddress.config" -Value "${{ steps.netlify2.outputs.NETLIFY_URL }}";
56+ shell : pwsh
57+
58+ - name : Dotnet Test
59+ run : dotnet test --configuration Release
60+
61+ - name : Semantic Release
62+ uses : cycjimmy/semantic-release-action@v2
63+ id : semantic
6364 with :
64- tag_name : v${{ steps.version.outputs.new_tag }}
65- release_name : Release ${{ steps.version.outputs.new_tag }}
66- draft : false
67- prerelease : false
65+ semantic_version : 17.4
66+ env :
67+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
68+
69+ - name : Dotnet Pack
70+ if : steps.semantic.outputs.new_release_published == 'true'
71+ working-directory : src/BlazorTable
72+ run : dotnet pack -c Release -p:Version=${{ steps.version.outputs.new_tag }}
73+
74+ - name : Dotnet Nuget Push
75+ if : steps.semantic.outputs.new_release_published == 'true'
76+ working-directory : src/BlazorTable/bin/Release
77+ run : dotnet nuget push BlazorTable.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
0 commit comments