From a9e1411f1a07c6b4839e9838fe7691beb2776139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 08:38:31 +0200 Subject: [PATCH 01/18] publish as native aot on windows remove releasenotes generation commented part use github actions output to avoid having the target framework everywhere --- .github/workflows/build.yml | 23 +++++++++++------------ ReleaseNotes.md | 1 + src/NVika/NVika.csproj | 1 - 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1af9382..fe0cf0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,8 +49,10 @@ jobs: run: dotnet test src --configuration Release --nologo --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - name: Build - shell: powershell - run: dotnet build src --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} + id: build + run: | + dotnet build src --configuration Release --no-restore + echo "{release_folder}=./src/NVika/bin/Release/net8.0" >> "$GITHUB_OUTPUT" - name: InspectCode Analysis - old xml run: | @@ -75,7 +77,7 @@ jobs: - name: GendarmeAnalysis run: | nuget install mono.gendarme -ExcludeVersion -OutputDirectory tools - ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore .\src\NVika\bin\Release\net8.0\NVika.exe + ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore ${{ steps.build.outputs.release_folder }}/NVika.exe - uses: actions/upload-artifact@v4 with: @@ -83,30 +85,27 @@ jobs: name: GendarmeReport.xml - name: LaunchNVika - run: .\src\NVika\bin\Release\net8.0\NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json ./src/NVika/bin/Release/net8.0/static-analysis.sarif.json GendarmeReport.xml + run: ${{ steps.build.outputs.release_folder }}/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json ${{ steps.build.outputs.release_folder }}/static-analysis.sarif.json GendarmeReport.xml - # - name: Create release notes - # run: | - # dotnet SemanticReleaseNotesParser -g=categories --debug -o="artifacts/ReleaseNotes.html" --pluralizecategoriestitle --includestyle - # dotnet SemanticReleaseNotesParser -g=categories --debug -t=environment -f=markdown --pluralizecategoriestitle + - name: Create Nuget package + run: dotnet pack src --configuration Release --nologo --no-build /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} - name: Create MSBuild package run: | Copy-Item -Path resources/icon.png -Destination src\NVika.MSBuild\ mkdir src\NVika.MSBuild\tools\ - Copy-Item -Path "src/NVika/bin/Release/net8.0/publish/*" -Destination src\NVika.MSBuild\tools\ + Copy-Item -Path "${{ steps.build.outputs.release_folder }}/publish/*" -Destination src\NVika.MSBuild\tools\ nuget pack src/NVika.MSBuild/NVika.MSBuild.nuspec -Version ${{ steps.gitversion.outputs.nuGetVersionV2 }} -OutputDirectory artifacts/nuget - name: Create netcore packages run: | mkdir ./artifacts/zips - Compress-Archive -Path src/NVika/bin/Release/net8.0/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" + Compress-Archive -Path ${{ steps.build.outputs.release_folder }}/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" Copy-Item -Path "src/NVika/bin/Release/NVika.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg" -Destination artifacts/nuget - name: Create windows version run: | - dotnet publish src/NVika --configuration Release --output ./publish --self-contained true --runtime win-x86 -p:PublishSingleFile=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} - # Copy-Item -Path "artifacts/ReleaseNotes.html" -Destination publish + dotnet publish src/NVika --configuration Release --output ./publish --runtime win-x86 -p:PublishAot=true -p:PublishSingleFile=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} Compress-Archive -Path publish/* -DestinationPath "artifacts/zips/NVika.win-x86.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" - name: Create chocolatey version diff --git a/ReleaseNotes.md b/ReleaseNotes.md index cae7845..7b9fdd9 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,6 @@ # next +- [#479](https://github.com/laedit/vika/pull/479) - Publish as native AOT on windows +enhancement - [#478](https://github.com/laedit/vika/pull/478) - Upgrade to .NET 8 +breaking - [#477](https://github.com/laedit/vika/pull/477) - Fix license on nuget +enhancement diff --git a/src/NVika/NVika.csproj b/src/NVika/NVika.csproj index f017560..e0a2f29 100644 --- a/src/NVika/NVika.csproj +++ b/src/NVika/NVika.csproj @@ -7,7 +7,6 @@ true nvika laedit - true Tool - Parse analysis reports (InspectCode, ...) and send messages to build server or console. Apache-2.0 icon.png From 2a35e592957cb922e78dd6333a493739873a498a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 13:43:10 +0200 Subject: [PATCH 02/18] trying with env --- .github/workflows/build.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe0cf0a..444dc3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,9 +75,11 @@ jobs: name: inspectcodereport.json - name: GendarmeAnalysis + env: + RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} run: | nuget install mono.gendarme -ExcludeVersion -OutputDirectory tools - ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore ${{ steps.build.outputs.release_folder }}/NVika.exe + ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore "$RELEASE_FOLDER/NVika.exe" - uses: actions/upload-artifact@v4 with: @@ -85,22 +87,28 @@ jobs: name: GendarmeReport.xml - name: LaunchNVika - run: ${{ steps.build.outputs.release_folder }}/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json ${{ steps.build.outputs.release_folder }}/static-analysis.sarif.json GendarmeReport.xml + env: + RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} + run: $RELEASE_FOLDER/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json $RELEASE_FOLDER/static-analysis.sarif.json GendarmeReport.xml - name: Create Nuget package run: dotnet pack src --configuration Release --nologo --no-build /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} - name: Create MSBuild package + env: + RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} run: | Copy-Item -Path resources/icon.png -Destination src\NVika.MSBuild\ mkdir src\NVika.MSBuild\tools\ - Copy-Item -Path "${{ steps.build.outputs.release_folder }}/publish/*" -Destination src\NVika.MSBuild\tools\ + Copy-Item -Path "$RELEASE_FOLDER/publish/*" -Destination src\NVika.MSBuild\tools\ nuget pack src/NVika.MSBuild/NVika.MSBuild.nuspec -Version ${{ steps.gitversion.outputs.nuGetVersionV2 }} -OutputDirectory artifacts/nuget - name: Create netcore packages + env: + RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} run: | mkdir ./artifacts/zips - Compress-Archive -Path ${{ steps.build.outputs.release_folder }}/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" + Compress-Archive -Path $RELEASE_FOLDER/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" Copy-Item -Path "src/NVika/bin/Release/NVika.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg" -Destination artifacts/nuget - name: Create windows version From a5443f1ce85f7c17f57183a9cc05703034781ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 13:53:03 +0200 Subject: [PATCH 03/18] fix build output name --- .github/workflows/build.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 444dc3b..dd9849c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: id: build run: | dotnet build src --configuration Release --no-restore - echo "{release_folder}=./src/NVika/bin/Release/net8.0" >> "$GITHUB_OUTPUT" + echo "release_folder=./src/NVika/bin/Release/net8.0" >> "$GITHUB_OUTPUT" - name: InspectCode Analysis - old xml run: | @@ -75,11 +75,9 @@ jobs: name: inspectcodereport.json - name: GendarmeAnalysis - env: - RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} run: | nuget install mono.gendarme -ExcludeVersion -OutputDirectory tools - ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore "$RELEASE_FOLDER/NVika.exe" + ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore ${{ steps.build.outputs.release_folder }}/NVika.exe - uses: actions/upload-artifact@v4 with: @@ -87,28 +85,22 @@ jobs: name: GendarmeReport.xml - name: LaunchNVika - env: - RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} - run: $RELEASE_FOLDER/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json $RELEASE_FOLDER/static-analysis.sarif.json GendarmeReport.xml + run: ${{ steps.build.outputs.release_folder }}/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json ${{ steps.build.outputs.release_folder }}/static-analysis.sarif.json GendarmeReport.xml - name: Create Nuget package run: dotnet pack src --configuration Release --nologo --no-build /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} - name: Create MSBuild package - env: - RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} run: | Copy-Item -Path resources/icon.png -Destination src\NVika.MSBuild\ mkdir src\NVika.MSBuild\tools\ - Copy-Item -Path "$RELEASE_FOLDER/publish/*" -Destination src\NVika.MSBuild\tools\ + Copy-Item -Path "${{ steps.build.outputs.release_folder }}/publish/*" -Destination src\NVika.MSBuild\tools\ nuget pack src/NVika.MSBuild/NVika.MSBuild.nuspec -Version ${{ steps.gitversion.outputs.nuGetVersionV2 }} -OutputDirectory artifacts/nuget - name: Create netcore packages - env: - RELEASE_FOLDER: ${{ steps.build.outputs.release_folder }} run: | mkdir ./artifacts/zips - Compress-Archive -Path $RELEASE_FOLDER/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" + Compress-Archive -Path ${{ steps.build.outputs.release_folder }}/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" Copy-Item -Path "src/NVika/bin/Release/NVika.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg" -Destination artifacts/nuget - name: Create windows version From 7f71d8c1f3c42c8d46cb43f6c7f9f4d466e79d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:05:50 +0200 Subject: [PATCH 04/18] fix dotnet setup --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd9849c..7a3742f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Install GitVersion uses: gittools/actions/gitversion/setup@v1.1.1 From b14a16f3b3737a9a94b01227916e56794004fb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:10:38 +0200 Subject: [PATCH 05/18] fix build after test --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a3742f..6d80114 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,15 +45,15 @@ jobs: - name: Echo version run: echo ${{ steps.gitversion.outputs.nuGetVersionV2 }} - - name: Test - run: dotnet test src --configuration Release --nologo --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - - name: Build id: build run: | dotnet build src --configuration Release --no-restore echo "release_folder=./src/NVika/bin/Release/net8.0" >> "$GITHUB_OUTPUT" + - name: Test + run: dotnet test src --configuration Release --no-build --nologo --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + - name: InspectCode Analysis - old xml run: | nuget install JetBrains.ReSharper.CommandLineTools -ExcludeVersion -OutputDirectory tools From 32a9b472e662dae8a9198f1152397a8a462030de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:10:51 +0200 Subject: [PATCH 06/18] testing output code from the docs --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d80114..be651c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,17 @@ jobs: DOTNET_CLI_TELEMETRY_OPTOUT: true steps: + - name: Set color + id: color-selector + run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT" + - name: Get color + env: + SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} + run: | + echo "The selected color is $SELECTED_COLOR" + echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}" + exit 1 + - uses: actions/checkout@v4 - name: Fetch all history for all tags and branches From 897bf5dcaacf3233e9896471c8558b05b5a08d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:18:17 +0200 Subject: [PATCH 07/18] trying with cmd --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be651c9..0008b2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: steps: - name: Set color id: color-selector + shell: cmd run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT" - name: Get color env: From 9bfe20401dceeb511dcf2317f4f61032c4943bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:19:37 +0200 Subject: [PATCH 08/18] all with cmd? --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0008b2e..039fb25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: - name: Get color env: SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} + shell: cmd run: | echo "The selected color is $SELECTED_COLOR" echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}" From 2e13f77f5e2f01fa8939f0ed53dc5d7dedfa1943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:21:00 +0200 Subject: [PATCH 09/18] debugging github file --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 039fb25..e24ff4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,9 @@ jobs: - name: Set color id: color-selector shell: cmd - run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT" + run: | + echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT" + type "$GITHUB_OUTPUT" - name: Get color env: SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} From f9ae931dd2fc6e16a165c3d522ade022174191a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:25:37 +0200 Subject: [PATCH 10/18] using powershell exemple this time --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e24ff4f..ee035c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,16 +17,14 @@ jobs: steps: - name: Set color id: color-selector - shell: cmd run: | - echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT" + "SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append type "$GITHUB_OUTPUT" - name: Get color env: SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} - shell: cmd run: | - echo "The selected color is $SELECTED_COLOR" + echo "The selected color is $env:SELECTED_COLOR" echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}" exit 1 From c9361d1d548fc7ae69b8bf4e434be6955e9a567b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:30:50 +0200 Subject: [PATCH 11/18] fix --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee035c6..88333ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,6 @@ jobs: id: color-selector run: | "SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - type "$GITHUB_OUTPUT" - name: Get color env: SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} From c621f1a8d7ed13601b909fb661d5e1b9317e2a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:35:00 +0200 Subject: [PATCH 12/18] trying with simplified command --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88333ca..3198db1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Set color id: color-selector run: | - "SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "SELECTED_COLOR=green" >> $env:GITHUB_OUTPUT - name: Get color env: SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} @@ -62,6 +62,7 @@ jobs: run: | dotnet build src --configuration Release --no-restore echo "release_folder=./src/NVika/bin/Release/net8.0" >> "$GITHUB_OUTPUT" + "SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - name: Test run: dotnet test src --configuration Release --no-build --nologo --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover From b8f2b4f8ded977d10825572eb72ac5d40288969c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:36:34 +0200 Subject: [PATCH 13/18] fix build output --- .github/workflows/build.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3198db1..53ce3e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,18 +15,6 @@ jobs: DOTNET_CLI_TELEMETRY_OPTOUT: true steps: - - name: Set color - id: color-selector - run: | - "SELECTED_COLOR=green" >> $env:GITHUB_OUTPUT - - name: Get color - env: - SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }} - run: | - echo "The selected color is $env:SELECTED_COLOR" - echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_COLOR }}" - exit 1 - - uses: actions/checkout@v4 - name: Fetch all history for all tags and branches @@ -61,8 +49,7 @@ jobs: id: build run: | dotnet build src --configuration Release --no-restore - echo "release_folder=./src/NVika/bin/Release/net8.0" >> "$GITHUB_OUTPUT" - "SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + echo "release_folder=./src/NVika/bin/Release/net8.0" >> $env:GITHUB_OUTPUT - name: Test run: dotnet test src --configuration Release --no-build --nologo --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover From f8e0e859259b48d6552b758afc6caa26577a78fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:45:29 +0200 Subject: [PATCH 14/18] restore needed since not done before --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53ce3e8..8b89751 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: - name: Build id: build run: | - dotnet build src --configuration Release --no-restore + dotnet build src --configuration Release echo "release_folder=./src/NVika/bin/Release/net8.0" >> $env:GITHUB_OUTPUT - name: Test From 850f126d31fd9e3022d064bf485fad9c71a6b608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 14:57:26 +0200 Subject: [PATCH 15/18] gendarme does not support .NET binaries --- .github/workflows/build.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b89751..4409972 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,18 +74,8 @@ jobs: path: inspectcodereport.json name: inspectcodereport.json - - name: GendarmeAnalysis - run: | - nuget install mono.gendarme -ExcludeVersion -OutputDirectory tools - ./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore ${{ steps.build.outputs.release_folder }}/NVika.exe - - - uses: actions/upload-artifact@v4 - with: - path: GendarmeReport.xml - name: GendarmeReport.xml - - name: LaunchNVika - run: ${{ steps.build.outputs.release_folder }}/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json ${{ steps.build.outputs.release_folder }}/static-analysis.sarif.json GendarmeReport.xml + run: ${{ steps.build.outputs.release_folder }}/NVika.exe --debug --includesource inspectcodereport.xml inspectcodereport.json ${{ steps.build.outputs.release_folder }}/static-analysis.sarif.json - name: Create Nuget package run: dotnet pack src --configuration Release --nologo --no-build /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} From d7a602dc57370472ac5a6fa1234bf3ad24f3cc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 15:01:53 +0200 Subject: [PATCH 16/18] native aot does not support win-x86 --- .github/workflows/build.yml | 12 ++++++------ README.md | 4 ++-- chocolatey/tools/chocolateyInstall.ps1 | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4409972..d959e6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,12 +95,12 @@ jobs: - name: Create windows version run: | - dotnet publish src/NVika --configuration Release --output ./publish --runtime win-x86 -p:PublishAot=true -p:PublishSingleFile=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} - Compress-Archive -Path publish/* -DestinationPath "artifacts/zips/NVika.win-x86.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" + dotnet publish src/NVika --configuration Release --output ./publish --runtime win-x64 -p:PublishAot=true -p:PublishSingleFile=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} + Compress-Archive -Path publish/* -DestinationPath "artifacts/zips/NVika.win-x64.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" - name: Create chocolatey version run: | - $winVersionChecksum = (Get-FileHash "artifacts/zips/NVika.win-x86.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" -Algorithm SHA256).Hash + $winVersionChecksum = (Get-FileHash "artifacts/zips/NVika.win-x64.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" -Algorithm SHA256).Hash mkdir ./artifacts/chocolatey $installPath = "chocolatey/tools/chocolateyInstall.ps1" $originalContent = Get-Content $installPath @@ -156,14 +156,14 @@ jobs: asset_name: NVika.netcore.${{ steps.get_version.outputs.version }}.zip asset_content_type: application/zip - - name: Upload Zip win-x86 + - name: Upload Zip win-x64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifact/zips/NVika.win-x86.${{ steps.get_version.outputs.version }}.zip - asset_name: NVika.win-x86.${{ steps.get_version.outputs.version }}.zip + asset_path: ./artifact/zips/NVika.win-x64.${{ steps.get_version.outputs.version }}.zip + asset_name: NVika.win-x64.${{ steps.get_version.outputs.version }}.zip asset_content_type: application/zip - name: Chocolatey push diff --git a/README.md b/README.md index fa03ebb..a5b17fd 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Right now it's just a tiny tool which parse analysis reports and send messages t ## Installation - [Zip netcore](https://github.com/laedit/SemanticReleaseNotesParser/releases): download and extract -- [Zip win-x86](https://github.com/laedit/SemanticReleaseNotesParser/releases): download and extract -- [Chocolatey (win-x86)](https://chocolatey.org/packages/nvika/): `choco install nvika` +- [Zip win-x64](https://github.com/laedit/SemanticReleaseNotesParser/releases): download and extract +- [Chocolatey (win-x64)](https://chocolatey.org/packages/nvika/): `choco install nvika` - [Dotnet tool](https://www.nuget.org/packages/NVika/): `dotnet tool install NVika` - [MSBuild](https://www.nuget.org/packages/NVika.MSBuild/): `Install-Package NVika.MSBuild` diff --git a/chocolatey/tools/chocolateyInstall.ps1 b/chocolatey/tools/chocolateyInstall.ps1 index cb44091..3161951 100644 --- a/chocolatey/tools/chocolateyInstall.ps1 +++ b/chocolatey/tools/chocolateyInstall.ps1 @@ -1,4 +1,4 @@ $packageName = 'NVika' -$url = 'https://github.com/laedit/Vika/releases/download/v[version]/NVika.win-x86.[version].zip' +$url = 'https://github.com/laedit/Vika/releases/download/v[version]/NVika.win-x64.[version].zip' Install-ChocolateyZipPackage -PackageName "$packageName" -Url "$url" -UnzipLocation "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -Checksum '[checksum]' -ChecksumType 'sha256' From 88ddb22ed02ebc7d326fea9fca92667bba611695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 15:10:51 +0200 Subject: [PATCH 17/18] PublishTrimmed not supported with aot --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d959e6a..c10554c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: - name: Create windows version run: | - dotnet publish src/NVika --configuration Release --output ./publish --runtime win-x64 -p:PublishAot=true -p:PublishSingleFile=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} + dotnet publish src/NVika --configuration Release --output ./publish --runtime win-x64 -p:PublishAot=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} Compress-Archive -Path publish/* -DestinationPath "artifacts/zips/NVika.win-x64.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" - name: Create chocolatey version From e6aada1cd7d712553a4b7bc6e0c6884a6987b32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bertrand?= Date: Thu, 16 May 2024 15:41:39 +0200 Subject: [PATCH 18/18] fix release ntoes --- ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 7b9fdd9..2f271d4 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,6 +1,6 @@ # next -- [#479](https://github.com/laedit/vika/pull/479) - Publish as native AOT on windows +enhancement +- [#479](https://github.com/laedit/vika/pull/479) - Publish as native AOT on windows +breaking - [#478](https://github.com/laedit/vika/pull/478) - Upgrade to .NET 8 +breaking - [#477](https://github.com/laedit/vika/pull/477) - Fix license on nuget +enhancement