3636# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
3737# refer to https://github.com/microsoft/github-actions-for-desktop-apps
3838
39- name : Build NuGet Package
39+ name : Make release
4040
4141on :
42- release :
43- types : [published]
42+ workflow_dispatch :
4443
4544jobs :
4645
4746 build :
47+
48+ environment : release
4849
4950 strategy :
5051 matrix :
5556
5657 env :
5758 Project_Directory : NiL.JS
58- Solution_Name : $Project_Directory/NiL.JS.csproj # Replace with your solution name, i.e. MyWpfApp.sln.
59- Test_Project_Path : Tests/Tests.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
59+ Solution_Name : $Project_Directory/NiL.JS.csproj
60+ Test_Project_Path : Tests/Tests.csproj
6061 Nuget_Pack_Output_Directory : nuget
6162
6263 steps :
@@ -101,16 +102,13 @@ jobs:
101102 $certificatePath = Join-Path -Path $env:Project_Directory -ChildPath keys.snk
102103 [IO.File]::WriteAllBytes("$certificatePath", $snk_byte)
103104
104- # Execute all unit tests in the solution
105- - name : Execute unit tests on .NET Core 6.0
106- run : |
107- cd Tests
108- dotnet run --project ..\Utility\tiny-t4\ --framework net6.0
109- dotnet test -c Release -property:TargetFramework=net6.0 -property:SignAssembly=false -property:PublicSign=false
110-
105+
111106 # Create the app package by building and packaging the Windows Application Packaging project
112107 - name : Create the app package
113- run : ./pack.ps1
108+ run : |
109+ $VERSION=${{ vars.VERSION }}
110+ echo $VERSION
111+ ./pack.ps1
114112
115113 # Remove the pfx
116114 - name : Remove the snk
@@ -122,3 +120,27 @@ jobs:
122120 with :
123121 name : NuGet Package
124122 path : ${{ env.Nuget_Pack_Output_Directory }}
123+
124+ - name : Make release tag
125+ id : tag
126+ run : |
127+ echo $VERSION
128+ $TAG="${{ vars.VERSION }}.$(git rev-list --count origin/develop)"
129+ echo "tag=$TAG" >> $env:GITHUB_OUTPUT
130+ echo $GITHUB_OUTPUT
131+ echo $env:GITHUB_OUTPUT
132+ git tag $TAG
133+ git push --tags
134+
135+ - name : Build release message
136+ run : |
137+ echo ${{ steps.tag.outputs.tag }}
138+ ./buildReleaseMessage.ps1 > ./release.md
139+
140+ - name : Make release ${{ steps.tag.outputs.tag }}
141+ uses : ncipollo/release-action@v1
142+ with :
143+ tag : ${{ steps.tag.outputs.tag }}
144+ name : ${{ steps.tag.outputs.tag }}
145+ artifacts : ${{ env.Nuget_Pack_Output_Directory }}/*
146+ bodyFile : ./release.md
0 commit comments