Skip to content

Commit 7269ed4

Browse files
committed
Test update CI action
1 parent fc033c3 commit 7269ed4

File tree

1 file changed

+35
-27
lines changed

1 file changed

+35
-27
lines changed

.github/workflows/CI.yml

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,50 @@ on:
1111
- beta
1212

1313
jobs:
14-
build:
14+
test:
1515
runs-on: ubuntu-latest
16-
1716
steps:
1817
- uses: actions/checkout@v3
19-
20-
- name: Semantic Release
21-
uses: cycjimmy/semantic-release-action@v3
22-
id: semantic
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
2618
- name: Setup .NET
2719
uses: actions/setup-dotnet@v3
2820
with:
2921
dotnet-version: 8.0.x
30-
3122
- name: Restore
3223
run: dotnet restore /property:Configuration=Release
33-
34-
- name: Write release notes
35-
env:
36-
RELEASE_NOTES: "${{ steps.semantic.outputs.new_release_notes}}"
37-
run: echo "$RELEASE_NOTES" > "./src/Whaally.Domain/release-notes.txt"
38-
3924
- name: Build for Publish
40-
run: |
41-
if [ ! -z "${{ steps.semantic.outputs.new_release_version }}" ]; then
42-
dotnet build --configuration Release /property:Version="${{ steps.semantic.outputs.new_release_version }}" /property:AssemblyVersion="${{steps.semantic.outputs.new_release_major_version}}" /property:AssemblyFileVersion="${{ steps.semantic.outputs.new_release_version }}" --no-restore
43-
else
44-
dotnet build --configuration Release --no-restore
45-
fi
46-
25+
run: dotnet build --configuration Release --no-restore
4726
- name: Test
4827
run: dotnet test /property:Configuration=Release --no-restore --no-build --verbosity normal
49-
50-
- name: Publish
51-
if: startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/beta')
52-
run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate
28+
release:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Semantic Release
33+
uses: cycjimmy/semantic-release-action@v3
34+
id: semantic
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Setup .NET
38+
if: steps.semantic.outputs.new_release_published
39+
uses: actions/setup-dotnet@v3
40+
with:
41+
dotnet-version: 8.0.x
42+
- name: Restore
43+
if: steps.semantic.outputs.new_release_published
44+
run: dotnet restore /property:Configuration=Release
45+
- name: Write release notes
46+
if: steps.semantic.outputs.new_release_published
47+
env:
48+
RELEASE_NOTES: "${{ steps.semantic.outputs.new_release_notes}}"
49+
run: echo "$RELEASE_NOTES" > "./src/Whaally.Domain/release-notes.txt"
50+
- name: Build for Publish
51+
if: steps.semantic.outputs.new_release_published
52+
run: |
53+
if [ ! -z "${{ steps.semantic.outputs.new_release_version }}" ]; then
54+
dotnet build --configuration Release /property:Version="${{ steps.semantic.outputs.new_release_version }}" /property:AssemblyVersion="${{steps.semantic.outputs.new_release_major_version}}" /property:AssemblyFileVersion="${{ steps.semantic.outputs.new_release_version }}" --no-restore
55+
else
56+
dotnet build --configuration Release --no-restore
57+
fi
58+
- name: Publish
59+
if: steps.semantic.outputs.new_release_published && (startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/beta'))
60+
run: dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate

0 commit comments

Comments
 (0)