Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit cf04d52

Browse files
committed
chore: switched to semantic release
1 parent 4f42b16 commit cf04d52

File tree

4 files changed

+53
-36
lines changed

4 files changed

+53
-36
lines changed

.github/workflows/cicd.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
branches:
44
- '*'
55
- '!master'
6+
- '!beta'
67

78
name: CI/CD
89
jobs:
@@ -38,9 +39,7 @@ jobs:
3839

3940
- name: Get Test Address
4041
run: |
41-
$url = '${{ steps.netlify.outputs.NETLIFY_URL }}';
42-
Write-Output $url;
43-
Set-Content -Path "src/BlazorTable.Tests/BrowserTestsAddress.config" -Value $url;
42+
Set-Content -Path "src/BlazorTable.Tests/BrowserTestsAddress.config" -Value "${{ steps.netlify.outputs.NETLIFY_URL }}";
4443
shell: pwsh
4544

4645
- name: Dotnet Test

.github/workflows/build.yml renamed to .github/workflows/pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
pull_request:
33
branches:
44
- '*'
5+
56
name: Build
67
jobs:
78
build:

.github/workflows/release.yml

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ on:
22
push:
33
branches:
44
- master
5+
- beta
56

67
name: Create Release
78
jobs:
@@ -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 }}

.releaserc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/github"
6+
]
7+
}

0 commit comments

Comments
 (0)