From 6eb086e18366c5cf331f336612f18f72e5a4654c Mon Sep 17 00:00:00 2001 From: Mark Kromis <143529142+mkromis@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:13:24 -0500 Subject: [PATCH 1/5] build fixes --- .github/workflows/deploy.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aa80e8f7..77e2a746 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,16 +1,16 @@ #Note: This is a third party action and currently only supports Linux: https://github.com/marketplace/actions/create-zip-file +name: 'Deploy Nugets' -name: ${{ env.GitVersion.NuGetVersion }} +on: + push: + branches: + - stable env: solution: '**/MinoriEditorShell.sln' buildPlatform: Any CPU buildConfiguration: Release -on: - push: - branches: - - stable jobs: build: runs-on: windows-latest @@ -27,10 +27,14 @@ jobs: uses: gittools/actions/gitversion/execute@v0.9.7 with: updateAssemblyInfo: true + - run: nuget restore ${{env.solution}} + - run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}' + - name: Copy Nugets to demo folder run: Copy '${{ env.agent.builddirectory }}/**/*.nupkg' '${{ env.Build.BinariesDirectory }}\Minori-${{ env.GitVersion.NuGetVersion }}\Nugets' + - name: Copy Nuget Files to artifacts run: Copy '${{ env.agent.builddirectory }}/**/*.nupkg' '${{ github.workspace }}' From 26a43cea28afe2c8b33a9f799e84f292603ce8a2 Mon Sep 17 00:00:00 2001 From: Mark Kromis <143529142+mkromis@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:22:12 -0500 Subject: [PATCH 2/5] tweak build --- .github/workflows/deploy.yml | 84 ++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 77e2a746..a086889e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,7 +7,7 @@ on: - stable env: - solution: '**/MinoriEditorShell.sln' + solution: 'MinoriEditorShell.sln' buildPlatform: Any CPU buildConfiguration: Release @@ -15,64 +15,62 @@ jobs: build: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: microsoft/setup-msbuild@v1.0.2 + - name: 'Checkout Sources' + uses: actions/checkout@v2 + + - name: 'Setup msbuild' + uses: microsoft/setup-msbuild@v1.0.2 + - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0.9.7 with: versionSpec: 5.x - - name: Use NuGet > 5.0.0 + + - name: Setup NuGet uses: nuget/setup-nuget@v1 - - name: GitVersion + + - name: Determine Version uses: gittools/actions/gitversion/execute@v0.9.7 - with: - updateAssemblyInfo: true - run: nuget restore ${{env.solution}} - run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}' - - name: Copy Nugets to demo folder - run: Copy '${{ env.agent.builddirectory }}/**/*.nupkg' '${{ env.Build.BinariesDirectory }}\Minori-${{ env.GitVersion.NuGetVersion }}\Nugets' - - - name: Copy Nuget Files to artifacts - run: Copy '${{ env.agent.builddirectory }}/**/*.nupkg' '${{ github.workspace }}' - - - name: Copy SimpleDemo.WPF Files + - name: Create Artifacts run: | - Copy 'Demos/SimpleDemo/SimpleDemo.Wpf/bin/Release/*.exe - *.dll - *\*.dll - ' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/SimpleDemo' + # Get list of all nupkgs + $nupkgs = Get-ChildItem -Path .\Modules -Filter *.nupkg -Recurse - - name: Copy SimpleDemo.RibbonWPF Files - run: | - Copy 'Demos/SimpleDemo/SimpleDemo.RibbonWpf/bin/Release/*.exe - *.dll - */*.dll - ' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/SimpleDemo' + $basedir = 'MinoriEditorSystem-' + $env:GitVersion_NuGetVersion - - name: Copy MinoriDemo.WPF Files - run: | - Copy 'Demos/MinoriDemo/MinoriDemo.Wpf/bin/Release/*.exe - *.dll - */*.dll - ' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/MinoriDemo' + # Move each item into artifacts + # rm Artifacts -Recurse -Force + mkdir Artifacts\$basedir\Nugets - - name: Copy MinoriEditorShell.RibbonWPF Files - run: | - Copy 'Demos/MinoriDemo/MinoriDemo.RibbonWpf/bin/Release/*.exe - *.dll - */*.dll - ' '${{ env.Build.BinariesDirectory }}/Minori-${{ env.GitVersion.NuGetVersion }}/Demos/MinoriDemo' + # Copy nugets to nuget folder + foreach ($nupkg in $nupkgs) { + $leaf = Split-Path $nupkg -Leaf + $outFile = "Artifacts\$basedir\Nugets\$leaf" + echo $nupkg.FullName ' -> ' $outFile + Copy-Item $nupkg.FullName $outFile + } - - # 'Note: This is a third party action and currently only supports Linux: https://github.com/marketplace/actions/create-zip-file' - uses: montudor/action-zip@v0.1.0 - with: - args: zip -qq -r ${{ github.workspace }}/Minori-${{ env.GitVersion.NuGetVersion }}.7z ${{ env.Build.BinariesDirectory }}\Minori-${{ env.GitVersion.NuGetVersion }} + # Copy Demo Folder + #mkdir Artifacts\$basedir\Demos + cp Demos\SimpleDemo\SimpleDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.WPF -Recurse + cp Demos\SimpleDemo\SimpleDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.RibbonWPF -Recurse + cp Demos\MinoriDemo\MinoriDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.WPF -Recurse + cp Demos\MinoriDemo\MinoriDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.RibbonWPF -Recurse + + # Compress folder into 7z file + cd Artifacts + 7z a "$basedir.7z" $basedir + cd .. - - uses: actions/upload-artifact@v2 + - name: Upload Artifact + uses: actions/upload-artifact@v2 with: - path: ${{ github.workspace }} - name: drop + name: MinoriEditorShell + path: Artifacts/*.7z + if-no-files-found: error \ No newline at end of file From 9eb7309f7a8a392e2dcabe7dcb0733b18ccb8d17 Mon Sep 17 00:00:00 2001 From: Mark Kromis <143529142+mkromis@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:25:58 -0500 Subject: [PATCH 3/5] fetch 0 --- .github/workflows/deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a086889e..837bf05d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,6 +17,8 @@ jobs: steps: - name: 'Checkout Sources' uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: 'Setup msbuild' uses: microsoft/setup-msbuild@v1.0.2 @@ -31,9 +33,9 @@ jobs: - name: Determine Version uses: gittools/actions/gitversion/execute@v0.9.7 - + - run: nuget restore ${{env.solution}} - + - run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}' - name: Create Artifacts From 270f618d5e94044532c77b6d83601556b7a82aa4 Mon Sep 17 00:00:00 2001 From: Mark Kromis <143529142+mkromis@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:52:12 -0500 Subject: [PATCH 4/5] fix build --- .github/workflows/build.yml | 10 ++--- .github/workflows/deploy.yml | 78 ------------------------------------ 2 files changed, 4 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ffd8213..0ea4797e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,7 @@ on: push: branches: - develop + - stable pull_request: types: [opened, synchronize, reopened] @@ -47,9 +48,6 @@ jobs: with: useConfigFile: true - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1 - - name: Use NuGet > 5.0.0 uses: nuget/setup-nuget@v1 @@ -83,9 +81,9 @@ jobs: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # Needed to get PR information, if any SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} shell: powershell - run: > + run: > .\.sonar\scanner\dotnet-sonarscanner - begin /k:"mkromis_MinoriEditorShell" /o:"mkromis" + begin /k:"mkromis_MinoriEditorShell" /o:"mkromis" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml /v:${{steps.gitversion.outputs.semVer}} @@ -144,5 +142,5 @@ jobs: uses: actions/upload-artifact@v2 with: name: MinoriEditorShell - path: Artifacts/*.7z + path: Artifacts/* if-no-files-found: error diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 837bf05d..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,78 +0,0 @@ -#Note: This is a third party action and currently only supports Linux: https://github.com/marketplace/actions/create-zip-file -name: 'Deploy Nugets' - -on: - push: - branches: - - stable - -env: - solution: 'MinoriEditorShell.sln' - buildPlatform: Any CPU - buildConfiguration: Release - -jobs: - build: - runs-on: windows-latest - steps: - - name: 'Checkout Sources' - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - name: 'Setup msbuild' - uses: microsoft/setup-msbuild@v1.0.2 - - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.7 - with: - versionSpec: 5.x - - - name: Setup NuGet - uses: nuget/setup-nuget@v1 - - - name: Determine Version - uses: gittools/actions/gitversion/execute@v0.9.7 - - - run: nuget restore ${{env.solution}} - - - run: msbuild '${{ env.solution }}' /p:configuration='${{ env.buildConfiguration }}' /p:platform='${{ env.buildPlatform }}' - - - name: Create Artifacts - run: | - # Get list of all nupkgs - $nupkgs = Get-ChildItem -Path .\Modules -Filter *.nupkg -Recurse - - $basedir = 'MinoriEditorSystem-' + $env:GitVersion_NuGetVersion - - # Move each item into artifacts - # rm Artifacts -Recurse -Force - mkdir Artifacts\$basedir\Nugets - - # Copy nugets to nuget folder - foreach ($nupkg in $nupkgs) { - $leaf = Split-Path $nupkg -Leaf - $outFile = "Artifacts\$basedir\Nugets\$leaf" - echo $nupkg.FullName ' -> ' $outFile - Copy-Item $nupkg.FullName $outFile - } - - # Copy Demo Folder - #mkdir Artifacts\$basedir\Demos - cp Demos\SimpleDemo\SimpleDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.WPF -Recurse - cp Demos\SimpleDemo\SimpleDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\SimpleDemo.RibbonWPF -Recurse - cp Demos\MinoriDemo\MinoriDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.WPF -Recurse - cp Demos\MinoriDemo\MinoriDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.RibbonWPF -Recurse - - # Compress folder into 7z file - cd Artifacts - 7z a "$basedir.7z" $basedir - cd .. - - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: MinoriEditorShell - path: Artifacts/*.7z - if-no-files-found: error - \ No newline at end of file From 3016d973608f5cac1095444f19e8940268ec157b Mon Sep 17 00:00:00 2001 From: Mark Kromis <143529142+mkromis@users.noreply.github.com> Date: Tue, 27 Feb 2024 23:03:53 -0500 Subject: [PATCH 5/5] remove dup archive --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ea4797e..a2e09c9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,11 +123,6 @@ jobs: cp Demos\MinoriDemo\MinoriDemo.WPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.WPF -Recurse cp Demos\MinoriDemo\MinoriDemo.RibbonWPF\bin\Release\net6.0-windows Artifacts\$basedir\Demos\MinoriDemo.RibbonWPF -Recurse - # Compress folder into 7z file - cd Artifacts - 7z a "$basedir.7z" $basedir - cd .. - - name: Test run: dotnet test ${{env.solution}} --collect:"XPlat Code Coverage" --settings coverlet.runsettings