From c740b56f99329e49bb302bee4e047a42c46fea83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= Date: Wed, 20 Nov 2024 11:11:20 +0100 Subject: [PATCH 01/23] update CI process --- .github/workflows/ci.yml | 184 ++++++++++++------ .../Features/Editor/SyntaxColoring.feature | 2 +- .../Features/Editor/SyntaxErrors.feature | 2 +- 3 files changed, 129 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb5b3e8e..1692485d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,23 +12,28 @@ on: branches: [ "main" ] workflow_dispatch: inputs: - configuration: - description: 'Build Configuration' + deploy_packages: + description: 'deploy_packages: If the created package should be deployed (additional manual approval required by a release admin)' + type: boolean + default: false required: true - default: 'Release' - type: choice - options: - - Debug - - Release - production_release: - description: 'If the build produces a production package (resets version prefix)' + is_production_release: + description: 'is_production_release: Whether the release is a production release and not a pre-releaae (enabling this will update change log, increases version and tags commit)' type: boolean default: false required: true - version_suffix: - description: 'Suffix for the NuGet packages (without leading -). Build ID will be appended.' - default: manual + custom_version_suffix: + description: 'custom_version_suffix: Custom suffix for the NuGet packages (without leading -) for non-production releases. Default: empty for production release, "ci" for other runs. The build ID is always appended.' + required: false + custom_configuration: + description: 'custom_configuration: Custom build configuration. Default: "Debug" for CI builds, "Release" for deployments.' required: false + default: 'Default' + type: choice + options: + - Default + - Debug + - Release permissions: checks: write @@ -40,16 +45,20 @@ jobs: runs-on: windows-latest outputs: + product_version_prefix: ${{ steps.versions.outputs.product_version_prefix }} product_version_suffix: ${{ steps.versions.outputs.product_version_suffix }} - product_build_number: ${{ steps.versions.outputs.product_build_number }} + product_main_version: ${{ steps.versions.outputs.product_main_version }} + product_patch_version: ${{ steps.versions.outputs.product_patch_version }} + product_full_version: ${{ steps.versions.outputs.product_full_version }} product_configuration: ${{ steps.versions.outputs.product_configuration }} - build_params: ${{ steps.versions.outputs.build_params }} - test_params: ${{ steps.versions.outputs.test_params }} + deploy_packages: ${{ steps.versions.outputs.deploy_packages }} + is_production_release: ${{ steps.versions.outputs.is_production_release }} + + build_params: ${{ steps.build_params.outputs.build_params }} + test_params: ${{ steps.build_params.outputs.test_params }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: Setup .NET uses: actions/setup-dotnet@v4 with: @@ -57,78 +66,138 @@ jobs: - id: versions name: Calculate versions shell: pwsh - env: - APPINSIGHTS_KEY: ${{ secrets.APPINSIGHTS_KEY }} run: | - $productionReleaseSetting = "${{ inputs.production_release }}" - $productionRelease = $false - if ($productionReleaseSetting -eq 'true') { - $productionRelease = $true + $deployPackages = $false + if ("${{ inputs.deploy_packages }}" -eq 'true') { + $deployPackages = $true } - Write-Output "Production release: $productionRelease" + Write-Output "deploy_packages=$($deployPackages.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT + Write-Output "Deploy packages: $deployPackages" - $versionSuffix = "${{ inputs.version_suffix }}" - if ($productionRelease) { - $versionSuffix = '' + $isProductionRelease = $false + if ("${{ inputs.is_production_release }}" -eq 'true') { + $isProductionRelease = $true } - elseif ($versionSuffix -eq "") { + Write-Output "is_production_release=$($isProductionRelease.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT + Write-Output "Is production release: $isProductionRelease" + + $versionSuffix = "${{ inputs.custom_version_suffix }}" + if ($isProductionRelease){ + if ($versionSuffix -ne "") { + throw "The 'custom_version_suffix' setting cannot be used for production releases." + } + } + else { + if ($versionSuffix -eq "") { $date = [datetime]::Today $dateString = $date.ToString('yyyyMMdd') $versionSuffix = "ci$dateString-${env:GITHUB_RUN_NUMBER}" - } - else { + } + else { $versionSuffix = "$versionSuffix-${env:GITHUB_RUN_NUMBER}" + } } Write-Output "product_version_suffix=$versionSuffix" >> $env:GITHUB_OUTPUT - Write-Output "Product Suffix: $versionSuffix" + Write-Output "Product Version Suffix: $versionSuffix" - $buildNumber = ${env:GITHUB_RUN_NUMBER} - Write-Output "product_build_number=$buildNumber" >> $env:GITHUB_OUTPUT - Write-Output "Build Number: $buildNumber" - - $productConfig = "${{ inputs.configuration }}" - if ($productConfig -eq "") { + $productConfig = "${{ inputs.custom_configuration }}" + if (($productConfig -eq "Default") -or ($productConfig -eq "")) { + if ($deployPackages){ $productConfig = "Release" + } + else { + $productConfig = "Debug" + } } Write-Output "product_configuration=$productConfig" >> $env:GITHUB_OUTPUT Write-Output "Product Configuration: $productConfig" - $buildParams = "-p:VersionSuffix=$versionSuffix -property:ReqnrollBuildNumber=$buildNumber" - Write-Output "Build Params: $buildParams" - if ($productionRelease) { - $buildParams = "$buildParams -property:AppInsightsInstrumentationKey=$env:APPINSIGHTS_KEY" - Write-Output "Main Build Params Updated for Production" + # Load Version + $buildPropsXml = [xml](Get-Content Directory.Build.props) + $mainVersion = $($buildPropsXml.Project.PropertyGroup.ReqnrollMainVersion)[1].Trim() + Write-Output "product_main_version=$mainVersion" >> $env:GITHUB_OUTPUT + Write-Output "Product Main Version: $mainVersion" + + # we use the GH build number as patch number + $patchVersion = ${env:GITHUB_RUN_NUMBER} + Write-Output "product_patch_version=$patchVersion" >> $env:GITHUB_OUTPUT + Write-Output "Product Patch Version: $patchVersion" + + $versionPrefix = "$mainVersion.$patchVersion" + Write-Output "product_version_prefix=$versionPrefix" >> $env:GITHUB_OUTPUT + Write-Output "Product Version Prefix: $versionPrefix" + + $fullVersion = $versionPrefix + if ($versionSuffix -ne "") { + $fullVersion = "$fullVersion-$versionSuffix" } + Write-Output "product_full_version=$fullVersion" >> $env:GITHUB_OUTPUT + Write-Output "Product Full Version: $fullVersion" + + - id: build_params + name: Calculate build parameters + shell: pwsh + env: + APPINSIGHTS_KEY: ${{ secrets.APPINSIGHTS_KEY }} + run: | + # Load version fields to variables + $versionSuffix = '${{ steps.versions.outputs.product_version_suffix }}' + $productConfig = '${{ steps.versions.outputs.product_configuration }}' + $patchVersion = '${{ steps.versions.outputs.product_patch_version }}' + $deployPackages = '${{ steps.versions.outputs.deploy_packages }}' -eq 'true' + + # Calculate 'build_params' + # configuration is handled in a special way during build, hence not included here + $buildParams = "-p:VersionSuffix=$versionSuffix -property:ReqnrollBuildNumber=$patchVersion" Write-Output "build_params=$buildParams" >> $env:GITHUB_OUTPUT + Write-Output "Build Params: $buildParams" + # Calculate 'main_build_params' + $mainBuildParams = $buildParams + if ($deployPackages) { + $mainBuildParams = "$mainBuildParams -p:AppInsightsInstrumentationKey=$env:APPINSIGHTS_KEY" + Write-Output "Main Build Params Updated for Deployment" + } + Write-Output "main_build_params=$mainBuildParams" >> $env:GITHUB_OUTPUT + + # Calculate 'test_params' $gitHubActionsLoggerSettings = '"GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.titleFormat=[@traits.Category] @test;annotations.messageFormat=@error\n@trace"' - $testParams = "--no-build --verbosity normal -c $productConfig --logger trx --logger $gitHubActionsLoggerSettings -- RunConfiguration.CollectSourceInformation=true" + $testParams = "--no-build --verbosity normal -c $productConfig --logger trx --logger $gitHubActionsLoggerSettings -- RunConfiguration.CollectSourceInformation=true RunConfiguration.TreatNoTestsAsError=true" Write-Output "test_params=$testParams" >> $env:GITHUB_OUTPUT Write-Output "Test Params: $testParams" + - name: Update Changelog + shell: pwsh + run: | + $releaseDate = [System.DateTime]::Today.ToString("yyyy-MM-dd") + $newHeading = "# v${{ steps.versions.outputs.product_full_version }} - $releaseDate" + $content = [System.IO.File]::ReadAllText("CHANGELOG.md").Replace("# [vNext]",$newHeading) + [System.IO.File]::WriteAllText("CHANGELOG.md", $content) + - name: Restore dependencies run: dotnet restore - name: Build Connectors shell: pwsh run: | cd Connectors - .\build.ps1 -configuration ${{ steps.versions.outputs.product_configuration }} -additionalArgs "${{ steps.versions.outputs.build_params }}" - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.3 + .\build.ps1 -configuration ${{ steps.versions.outputs.product_configuration }} -additionalArgs "${{ steps.build_params.outputs.main_build_params }}" - name: Install Test Report Dependencies run: | dotnet add ./Tests/Reqnroll.VisualStudio.Specs/Reqnroll.VisualStudio.Specs.csproj package GitHubActionsTestLogger dotnet add ./Tests/Reqnroll.VisualStudio.Tests/Reqnroll.VisualStudio.Tests.csproj package GitHubActionsTestLogger dotnet add ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj package GitHubActionsTestLogger dotnet add ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj package GitHubActionsTestLogger + - name: Add MsBuild to PATH + uses: microsoft/setup-msbuild@v1.3 - name: Build - run: msbuild -restore -target:Rebuild -property:DeployExtension=false -property:Configuration=${{ steps.versions.outputs.product_configuration }} ${{ steps.versions.outputs.build_params }} + run: msbuild -restore -target:Rebuild -property:DeployExtension=false -property:Configuration=${{ steps.versions.outputs.product_configuration }} ${{ steps.build_params.outputs.main_build_params }} - name: Unit Tests - run: dotnet test ./Tests/Reqnroll.VisualStudio.Tests/Reqnroll.VisualStudio.Tests.csproj ${{ steps.versions.outputs.test_params }} - - name: Upload vsix + run: dotnet test ./Tests/Reqnroll.VisualStudio.Tests/Reqnroll.VisualStudio.Tests.csproj ${{ steps.build_params.outputs.test_params }} + - name: Upload VSIX uses: actions/upload-artifact@v4 with: - name: vsix - path: "Reqnroll.VisualStudio.Package/**/*.vsix" + name: vsix-v${{ steps.versions.outputs.product_full_version }} + if-no-files-found: error + path: "Reqnroll.VisualStudio.Package/bin/${{ steps.versions.outputs.product_configuration }}/net481/*.vsix" - uses: nuget/setup-nuget@v1.2 - name: Prepare Connector Tests shell: pwsh @@ -138,18 +207,19 @@ jobs: cd PackagesForTests nuget install packages.config - name: Connector Tests - run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj ${{ steps.versions.outputs.test_params }} + run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj ${{ steps.build_params.outputs.test_params }} - name: Connector V1 Tests - run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj ${{ steps.versions.outputs.test_params }} + run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj ${{ steps.build_params.outputs.test_params }} - name: Specs Tests run: > dotnet test ./Tests/Reqnroll.VisualStudio.Specs/Reqnroll.VisualStudio.Specs.csproj - --filter "Category!=quarantaine" - ${{ steps.versions.outputs.test_params }} + --filter "Category!=quarantine" + ${{ steps.build_params.outputs.test_params }} - name: Upload Test Result TRX Files uses: actions/upload-artifact@v4 - if: success() || failure() + if: always() with: - name: trx-test-results + name: build-trx-v${{ steps.versions.outputs.product_full_version }} + if-no-files-found: error path: "**/*.trx" \ No newline at end of file diff --git a/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxColoring.feature b/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxColoring.feature index 019342eb..a06559b8 100644 --- a/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxColoring.feature +++ b/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxColoring.feature @@ -369,7 +369,7 @@ Scenario: Highlights Scenario Outline placeholders Rule: Language configuration changes are applied to open feature file editors # this scenario is flaky on CI -@quarantaine +@quarantine Scenario: Default feature file language was changed Given there is a non-Reqnroll project scope And the reqnroll.json configuration file contains diff --git a/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxErrors.feature b/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxErrors.feature index ad543cd2..16757aed 100644 --- a/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxErrors.feature +++ b/Tests/Reqnroll.VisualStudio.Specs/Features/Editor/SyntaxErrors.feature @@ -7,7 +7,7 @@ Rules: * Highlights semantic errors # this scenario is flaky on CI -@quarantaine +@quarantine Scenario: Highlights syntax errors Given there is a Reqnroll project scope When the following feature file is opened in the editor From 73fd001eaa969460cf6d0365058a9c2de608b98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= Date: Wed, 20 Nov 2024 11:23:03 +0100 Subject: [PATCH 02/23] fix reading version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1692485d..097bc568 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,7 @@ jobs: # Load Version $buildPropsXml = [xml](Get-Content Directory.Build.props) - $mainVersion = $($buildPropsXml.Project.PropertyGroup.ReqnrollMainVersion)[1].Trim() + $mainVersion = $buildPropsXml.SelectSingleNode('//Project/PropertyGroup/ReqnrollMainVersion/text()').Value.Trim() Write-Output "product_main_version=$mainVersion" >> $env:GITHUB_OUTPUT Write-Output "Product Main Version: $mainVersion" From 152547ab7ae908f46b9528709c6bc760acc0fabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= Date: Wed, 20 Nov 2024 12:18:42 +0100 Subject: [PATCH 03/23] Add release job (unfinished) --- .github/workflows/ci.yml | 93 ++++++++++++++++++++++++++++++- .marketplace/publishManifest.json | 2 +- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 097bc568..7d4d9201 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,4 +222,95 @@ jobs: name: build-trx-v${{ steps.versions.outputs.product_full_version }} if-no-files-found: error path: "**/*.trx" - \ No newline at end of file + + release: + runs-on: ubuntu-latest + needs: [build] + environment: production_environment + if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # avoid shallow clone git commit + ref: ${{ github.head_ref }} + ssh-key: ${{secrets.RELEASE_GIT_SSH_KEY}} + - uses: actions/download-artifact@v4 + with: + name: vsix-v${{ needs.build.outputs.product_full_version }} + path: release_packages + - name: Deploy VSIX packages + env: + MARKETPLACE_PUBLISH_KEY: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} + shell: pwsh + run: | + Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" + ls ${{ github.workspace }}/release_packages + # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages + + - name: Calculate Next Version + if: needs.build.outputs.is_production_release == 'true' + id: next_version + shell: pwsh + run: | + $mainVersion = "${{ needs.build.outputs.product_main_version }}" + $majorVersion = &{$mainVersion -match '^\d+' > $null; $matches[0]} + $minorVersion = &{$mainVersion -match '\d+$' > $null; $matches[0]} + $nextMinor = [int]$minorVersion + 1 + $nextMainVersion = "$majorVersion.$nextMinor" + Write-Output "product_next_main_version=$nextMainVersion" >> $env:GITHUB_OUTPUT + Write-Output "Product Next Main Version: $nextMainVersion" + + - name: Bump Version + if: needs.build.outputs.is_production_release == 'true' + shell: pwsh + run: | + [System.IO.File]::WriteAllText("Directory.Build.props", [System.IO.File]::ReadAllText("Directory.Build.props").Replace("${{ needs.build.outputs.product_main_version }}", "${{ steps.next_version.outputs.product_next_main_version }}")) + # TODO: update vs templates + + - name: Update Changelog + if: needs.build.outputs.is_production_release == 'true' + id: changelog + shell: pwsh + run: | + $newHeading = "# [vNext]$([Environment]::NewLine)$([Environment]::NewLine)## Improvements:$([Environment]::NewLine)$([Environment]::NewLine)## Bug fixes:$([Environment]::NewLine)$([Environment]::NewLine)*Contributors of this release (in alphabetical order):* $([Environment]::NewLine)$([Environment]::NewLine)" + $releaseDate = [System.DateTime]::Today.ToString("yyyy-MM-dd") + $releaseTitle = "v${{ needs.build.outputs.product_full_version }} - $releaseDate" + $newHeading = $newHeading + "# $releaseTitle" + $content = [System.IO.File]::ReadAllText("CHANGELOG.md").Replace("# [vNext]",$newHeading) + [System.IO.File]::WriteAllText("CHANGELOG.md", $content) + Write-Output "New Heading:" + Write-Output $newHeading + + # calculate release notes + $match = [System.Text.RegularExpressions.Regex]::Match($content, "(?ms)^# .*?^# (?[^\r\n]*?)\s*$\s*(?<notes>.*?)\s*(?:^# |\Z)") + $releaseNotes = $(if ($match.Success) { $match.Groups["notes"].Value } else { "N/A" }) + [System.IO.File]::WriteAllText("release_notes.txt", $releaseNotes) + Write-Output "release_title=$releaseTitle" >> $env:GITHUB_OUTPUT + Write-Output "release_notes_file=release_notes.txt" >> $env:GITHUB_OUTPUT + + - name: Update changes in GitHub repository + if: needs.build.outputs.is_production_release == 'true' + run: | + git status + git config --global user.name 'Reqnroll CI' + git config --global user.email 'ci@reqnroll.net' + git tag v${{ needs.build.outputs.product_full_version }} + git push origin tag v${{ needs.build.outputs.product_full_version }} + git add -u + git commit -m '[automated commit] bump version after release of ${{ needs.build.outputs.product_full_version }}' + git push + + - name: Create GitHub Release + if: needs.build.outputs.is_production_release == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "v${{ needs.build.outputs.product_full_version }}" \ + --verify-tag \ + --title="${{ steps.changelog.outputs.release_title }}" \ + --notes-file="${{ steps.changelog.outputs.release_notes_file }}" diff --git a/.marketplace/publishManifest.json b/.marketplace/publishManifest.json index 7b07c34f..a717fbb2 100644 --- a/.marketplace/publishManifest.json +++ b/.marketplace/publishManifest.json @@ -6,7 +6,7 @@ }, "overview": "overview.md", "priceCategory": "free", - "publisher": "reqnroll", + "publisher": "Reqnroll", "private": false, "qna": true, "repo": "https://github.com/reqnroll/Reqnroll.VisualStudio" From 305de0003a03e5a93a2ac00c97e9d1f2c3f5e4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 12:27:18 +0100 Subject: [PATCH 04/23] remove bom from vstemplate --- .../FeatureFile/FeatureFile_CSharp.vstemplate | 2 +- .../FeatureFile/FeatureFile_VB.vstemplate | 2 +- .../Hooks/Hooks_CSharp.vstemplate | 2 +- Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_VB.vstemplate | 2 +- .../ReqnrollConfig/ReqnrollConfig_CSharp.vstemplate | 2 +- .../ReqnrollConfig/ReqnrollConfig_VB.vstemplate | 2 +- .../Reqnroll.VisualStudio.ProjectTemplate.vstemplate | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_CSharp.vstemplate b/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_CSharp.vstemplate index 6f6b6a6d..1939a6ab 100644 --- a/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_CSharp.vstemplate +++ b/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_CSharp.vstemplate @@ -1,4 +1,4 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> +<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> <TemplateData> <DefaultName>Feature.feature</DefaultName> <Name>Feature File for Reqnroll</Name> diff --git a/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_VB.vstemplate b/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_VB.vstemplate index cae1fb09..bd865978 100644 --- a/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_VB.vstemplate +++ b/Reqnroll.VisualStudio.ItemTemplates/FeatureFile/FeatureFile_VB.vstemplate @@ -1,4 +1,4 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> +<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> <TemplateData> <DefaultName>Feature.feature</DefaultName> <Name>Feature File for Reqnroll</Name> diff --git a/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_CSharp.vstemplate b/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_CSharp.vstemplate index 1cb0b8d6..91dcacd7 100644 --- a/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_CSharp.vstemplate +++ b/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_CSharp.vstemplate @@ -1,4 +1,4 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> +<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> <TemplateData> <DefaultName>Hooks.cs</DefaultName> <Name>Reqnroll Hooks (event bindings)</Name> diff --git a/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_VB.vstemplate b/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_VB.vstemplate index c4a88b10..b74c2da0 100644 --- a/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_VB.vstemplate +++ b/Reqnroll.VisualStudio.ItemTemplates/Hooks/Hooks_VB.vstemplate @@ -1,4 +1,4 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> +<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"> <TemplateData> <DefaultName>Hooks.cs</DefaultName> <Name>Reqnroll Hooks (event bindings)</Name> diff --git a/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_CSharp.vstemplate b/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_CSharp.vstemplate index 9309472a..7b87cfee 100644 --- a/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_CSharp.vstemplate +++ b/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_CSharp.vstemplate @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"> <TemplateData> <DefaultName>reqnroll.json</DefaultName> diff --git a/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_VB.vstemplate b/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_VB.vstemplate index b0fa807b..5755815d 100644 --- a/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_VB.vstemplate +++ b/Reqnroll.VisualStudio.ItemTemplates/ReqnrollConfig/ReqnrollConfig_VB.vstemplate @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"> <TemplateData> <DefaultName>reqnroll.json</DefaultName> diff --git a/Reqnroll.VisualStudio.ProjectTemplate/Reqnroll.VisualStudio.ProjectTemplate.vstemplate b/Reqnroll.VisualStudio.ProjectTemplate/Reqnroll.VisualStudio.ProjectTemplate.vstemplate index 22d9aa59..f2a07474 100644 --- a/Reqnroll.VisualStudio.ProjectTemplate/Reqnroll.VisualStudio.ProjectTemplate.vstemplate +++ b/Reqnroll.VisualStudio.ProjectTemplate/Reqnroll.VisualStudio.ProjectTemplate.vstemplate @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010"> <TemplateData> <Name>Reqnroll Project</Name> From 9730e20b089f8bda25ec404d58ac1d54aa7d1701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 12:28:11 +0100 Subject: [PATCH 05/23] update vstemplates during version bump --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d4d9201..714a75b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -270,7 +270,10 @@ jobs: shell: pwsh run: | [System.IO.File]::WriteAllText("Directory.Build.props", [System.IO.File]::ReadAllText("Directory.Build.props").Replace("<ReqnrollMainVersion>${{ needs.build.outputs.product_main_version }}</ReqnrollMainVersion>", "<ReqnrollMainVersion>${{ steps.next_version.outputs.product_next_main_version }}</ReqnrollMainVersion>")) - # TODO: update vs templates + $vsTemplates = Get-ChildItem -Path . -File -Recurse -Filter '*.vstemplate' + foreach ($vsTemplate in $vsTemplates) { + [System.IO.File]::WriteAllText($vsTemplate.FullName, [System.IO.File]::ReadAllText($vsTemplate.FullName).Replace("Version=${{ needs.build.outputs.product_main_version }}.0.0", "Version=${{ steps.next_version.outputs.product_next_main_version }}.0.0")) + } - name: Update Changelog if: needs.build.outputs.is_production_release == 'true' From 474698f5674bf5f94cc57abff9945af6840b8a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 12:30:05 +0100 Subject: [PATCH 06/23] remove release step conditions for test --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 714a75b0..b935a7ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,7 +227,7 @@ jobs: runs-on: ubuntu-latest needs: [build] environment: production_environment - if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' + # if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' permissions: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. @@ -253,7 +253,7 @@ jobs: # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages - name: Calculate Next Version - if: needs.build.outputs.is_production_release == 'true' + # if: needs.build.outputs.is_production_release == 'true' id: next_version shell: pwsh run: | @@ -266,7 +266,7 @@ jobs: Write-Output "Product Next Main Version: $nextMainVersion" - name: Bump Version - if: needs.build.outputs.is_production_release == 'true' + # if: needs.build.outputs.is_production_release == 'true' shell: pwsh run: | [System.IO.File]::WriteAllText("Directory.Build.props", [System.IO.File]::ReadAllText("Directory.Build.props").Replace("<ReqnrollMainVersion>${{ needs.build.outputs.product_main_version }}</ReqnrollMainVersion>", "<ReqnrollMainVersion>${{ steps.next_version.outputs.product_next_main_version }}</ReqnrollMainVersion>")) @@ -276,7 +276,7 @@ jobs: } - name: Update Changelog - if: needs.build.outputs.is_production_release == 'true' + # if: needs.build.outputs.is_production_release == 'true' id: changelog shell: pwsh run: | @@ -297,16 +297,16 @@ jobs: Write-Output "release_notes_file=release_notes.txt" >> $env:GITHUB_OUTPUT - name: Update changes in GitHub repository - if: needs.build.outputs.is_production_release == 'true' + # if: needs.build.outputs.is_production_release == 'true' run: | git status git config --global user.name 'Reqnroll CI' git config --global user.email 'ci@reqnroll.net' git tag v${{ needs.build.outputs.product_full_version }} - git push origin tag v${{ needs.build.outputs.product_full_version }} + # git push origin tag v${{ needs.build.outputs.product_full_version }} git add -u git commit -m '[automated commit] bump version after release of ${{ needs.build.outputs.product_full_version }}' - git push + # git push - name: Create GitHub Release if: needs.build.outputs.is_production_release == 'true' From a2522a385637378859a6e699a575e6127cd3fa69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 12:43:25 +0100 Subject: [PATCH 07/23] change job to use windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b935a7ef..c3c2cb89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,7 +224,7 @@ jobs: path: "**/*.trx" release: - runs-on: ubuntu-latest + runs-on: windows-latest needs: [build] environment: production_environment # if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' From bc740c661b906c2b7cd92cef1fe2e21188e7931d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 12:46:40 +0100 Subject: [PATCH 08/23] Revert "change job to use windows" This reverts commit a2522a385637378859a6e699a575e6127cd3fa69. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3c2cb89..b935a7ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,7 +224,7 @@ jobs: path: "**/*.trx" release: - runs-on: windows-latest + runs-on: ubuntu-latest needs: [build] environment: production_environment # if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' From 28e6f6474b92dab4fc33470109fe3fd6a8f8d08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 12:48:14 +0100 Subject: [PATCH 09/23] add "tfx extension publish --help" --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b935a7ef..1836909b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,6 +251,7 @@ jobs: Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" ls ${{ github.workspace }}/release_packages # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages + tfx extension publish --help - name: Calculate Next Version # if: needs.build.outputs.is_production_release == 'true' From fb3bd95a04302b41adc6e485fbc00b1071de3434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:07:12 +0100 Subject: [PATCH 10/23] comment out tests for faster debug --- .github/workflows/ci.yml | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1836909b..c3e9ce60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,30 +198,30 @@ jobs: name: vsix-v${{ steps.versions.outputs.product_full_version }} if-no-files-found: error path: "Reqnroll.VisualStudio.Package/bin/${{ steps.versions.outputs.product_configuration }}/net481/*.vsix" - - uses: nuget/setup-nuget@v1.2 - - name: Prepare Connector Tests - shell: pwsh - run: | - cd Tests/ExternalPackages - ./buildExternalPackages.ps1 - cd PackagesForTests - nuget install packages.config - - name: Connector Tests - run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj ${{ steps.build_params.outputs.test_params }} - - name: Connector V1 Tests - run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj ${{ steps.build_params.outputs.test_params }} - - name: Specs Tests - run: > - dotnet test ./Tests/Reqnroll.VisualStudio.Specs/Reqnroll.VisualStudio.Specs.csproj - --filter "Category!=quarantine" - ${{ steps.build_params.outputs.test_params }} - - name: Upload Test Result TRX Files - uses: actions/upload-artifact@v4 - if: always() - with: - name: build-trx-v${{ steps.versions.outputs.product_full_version }} - if-no-files-found: error - path: "**/*.trx" + # - uses: nuget/setup-nuget@v1.2 + # - name: Prepare Connector Tests + # shell: pwsh + # run: | + # cd Tests/ExternalPackages + # ./buildExternalPackages.ps1 + # cd PackagesForTests + # nuget install packages.config + # - name: Connector Tests + # run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj ${{ steps.build_params.outputs.test_params }} + # - name: Connector V1 Tests + # run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj ${{ steps.build_params.outputs.test_params }} + # - name: Specs Tests + # run: > + # dotnet test ./Tests/Reqnroll.VisualStudio.Specs/Reqnroll.VisualStudio.Specs.csproj + # --filter "Category!=quarantine" + # ${{ steps.build_params.outputs.test_params }} + # - name: Upload Test Result TRX Files + # uses: actions/upload-artifact@v4 + # if: always() + # with: + # name: build-trx-v${{ steps.versions.outputs.product_full_version }} + # if-no-files-found: error + # path: "**/*.trx" release: runs-on: ubuntu-latest From 6b27bce857f5f062000a5539ed2382734a53e019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:07:21 +0100 Subject: [PATCH 11/23] npm install -g tfx-cli --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3e9ce60..6f0d7eb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,6 +251,7 @@ jobs: Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" ls ${{ github.workspace }}/release_packages # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages + npm install -g tfx-cli tfx extension publish --help - name: Calculate Next Version From 4cfbd723d238900b01abc449a09a9ee15cd77de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:29:57 +0100 Subject: [PATCH 12/23] Revert "npm install -g tfx-cli" This reverts commit 6b27bce857f5f062000a5539ed2382734a53e019. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f0d7eb2..c3e9ce60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,7 +251,6 @@ jobs: Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" ls ${{ github.workspace }}/release_packages # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages - npm install -g tfx-cli tfx extension publish --help - name: Calculate Next Version From 728972a1373a966d38d78bf07e8d80deb6355458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:30:13 +0100 Subject: [PATCH 13/23] Revert "add "tfx extension publish --help"" This reverts commit 28e6f6474b92dab4fc33470109fe3fd6a8f8d08c. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3e9ce60..a44a7754 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,7 +251,6 @@ jobs: Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" ls ${{ github.workspace }}/release_packages # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages - tfx extension publish --help - name: Calculate Next Version # if: needs.build.outputs.is_production_release == 'true' From 15a77cf6b826d09eda3526840c61b68af890ae6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:30:28 +0100 Subject: [PATCH 14/23] Reapply "change job to use windows" This reverts commit bc740c661b906c2b7cd92cef1fe2e21188e7931d. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a44a7754..05e3bc24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,7 +224,7 @@ jobs: # path: "**/*.trx" release: - runs-on: ubuntu-latest + runs-on: windows-latest needs: [build] environment: production_environment # if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' From 362c4fab88306067db2988c4910824a937081140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:41:46 +0100 Subject: [PATCH 15/23] use GHA-VSMarketplacePublisher to publish --- .github/workflows/ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05e3bc24..05cb46d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,14 +243,22 @@ jobs: with: name: vsix-v${{ needs.build.outputs.product_full_version }} path: release_packages + # - name: Deploy VSIX packages + # env: + # MARKETPLACE_PUBLISH_KEY: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} + # shell: pwsh + # run: | + # Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" + # ls ${{ github.workspace }}/release_packages + # # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages + - name: Deploy VSIX packages - env: - MARKETPLACE_PUBLISH_KEY: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} - shell: pwsh - run: | - Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" - ls ${{ github.workspace }}/release_packages - # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages + uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 + with: + marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT_TMP }} + publish-manifest-path: ${{ github.workspace }}/.marketplace/publishManifest.json + vsix-path: ${{ github.workspace }}/release_packages/Reqnroll.VisualStudio.Package.v${{ needs.build.outputs.product_version_prefix }}.vsix + # vs-version: [17.0,18.0) - name: Calculate Next Version # if: needs.build.outputs.is_production_release == 'true' From a06f60867b9e3a6068021aa605bd85b61370e107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:53:46 +0100 Subject: [PATCH 16/23] cleanup Deploy VSIX packages --- .github/workflows/ci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05cb46d5..0555ac6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,22 +243,13 @@ jobs: with: name: vsix-v${{ needs.build.outputs.product_full_version }} path: release_packages - # - name: Deploy VSIX packages - # env: - # MARKETPLACE_PUBLISH_KEY: ${{ secrets.MARKETPLACE_PUBLISH_KEY }} - # shell: pwsh - # run: | - # Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) packages to Visual Studio Marketplace" - # ls ${{ github.workspace }}/release_packages - # # ${{ github.workspace }}/.github/workflows/publish_packages.ps1 -packagesDir ${{ github.workspace }}/release_packages - name: Deploy VSIX packages uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 with: - marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT_TMP }} + marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT }} publish-manifest-path: ${{ github.workspace }}/.marketplace/publishManifest.json vsix-path: ${{ github.workspace }}/release_packages/Reqnroll.VisualStudio.Package.v${{ needs.build.outputs.product_version_prefix }}.vsix - # vs-version: [17.0,18.0) - name: Calculate Next Version # if: needs.build.outputs.is_production_release == 'true' From 310ffe5ac407010d0804646e2adcddfaaf2b1978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 14:54:04 +0100 Subject: [PATCH 17/23] disable Deploy VSIX packages --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0555ac6d..afaba9b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,12 +244,12 @@ jobs: name: vsix-v${{ needs.build.outputs.product_full_version }} path: release_packages - - name: Deploy VSIX packages - uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 - with: - marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT }} - publish-manifest-path: ${{ github.workspace }}/.marketplace/publishManifest.json - vsix-path: ${{ github.workspace }}/release_packages/Reqnroll.VisualStudio.Package.v${{ needs.build.outputs.product_version_prefix }}.vsix + # - name: Deploy VSIX packages + # uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 + # with: + # marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT }} + # publish-manifest-path: ${{ github.workspace }}/.marketplace/publishManifest.json + # vsix-path: ${{ github.workspace }}/release_packages/Reqnroll.VisualStudio.Package.v${{ needs.build.outputs.product_version_prefix }}.vsix - name: Calculate Next Version # if: needs.build.outputs.is_production_release == 'true' From 7615abf524577d0cc8f222a6b4061e144736a459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 15:07:50 +0100 Subject: [PATCH 18/23] remove unneeded target to set the version in vstemplate --- .../Reqnroll.VisualStudio.Package.csproj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Reqnroll.VisualStudio.Package/Reqnroll.VisualStudio.Package.csproj b/Reqnroll.VisualStudio.Package/Reqnroll.VisualStudio.Package.csproj index aeff3c0f..3b6ae380 100644 --- a/Reqnroll.VisualStudio.Package/Reqnroll.VisualStudio.Package.csproj +++ b/Reqnroll.VisualStudio.Package/Reqnroll.VisualStudio.Package.csproj @@ -99,19 +99,6 @@ <Import Project="..\Connectors\DeploymentAssets.props" /> - <Target Name="ReplaceVersions" AfterTargets="GetBuildVersion" BeforeTargets="BeforeCompile"> - <ItemGroup> - <TemplateFiles Include="$(MSBuildThisFileDirectory)..\Reqnroll.VisualStudio.ItemTemplates\**\*.vstemplate" /> - <TemplateFiles Include="$(MSBuildThisFileDirectory)..\Reqnroll.VisualStudio.ProjectTemplate\**\*.vstemplate" /> - <VsChangeLog Include="$(MSBuildThisFileDirectory)..\CHANGELOG.md" /> - </ItemGroup> - - <WriteLinesToFile File="%(TemplateFiles.FullPath)" Lines="$([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText(%(TemplateFiles.FullPath))), 'Version=(\d+).(\d+).(\d+).(\d+),', 'Version=$(AssemblyVersion),'))" Overwrite="true" Encoding="UTF-8" /> - - <WriteLinesToFile Condition=" '$(Configuration)' == 'Release' " File="%(VsChangeLog.FullPath)" Lines="$([System.IO.File]::ReadAllText(%(VsChangeLog.FullPath)).Replace('[vNext]','v$(Version) - $([System.DateTime]::Now.ToString('yyyy-MM-dd'))'))" Overwrite="true" Encoding="UTF-8" /> - - </Target> - <!-- needed to include version in source.extension.vsixmanifest --> <Target Name="GetVsixVersion" Returns="$(ReqnrollPackageVersion)" BeforeTargets="BeforeCompile" AfterTargets="GetBuildVersion"> <Message Text="VSIX Version is set to: $(ReqnrollPackageVersion)" /> From 3499139b510f28241a1b22ce9cf3ba6792230742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 15:16:14 +0100 Subject: [PATCH 19/23] Add Review modified files --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afaba9b7..044fa166 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,6 +192,8 @@ jobs: run: msbuild -restore -target:Rebuild -property:DeployExtension=false -property:Configuration=${{ steps.versions.outputs.product_configuration }} ${{ steps.build_params.outputs.main_build_params }} - name: Unit Tests run: dotnet test ./Tests/Reqnroll.VisualStudio.Tests/Reqnroll.VisualStudio.Tests.csproj ${{ steps.build_params.outputs.test_params }} + - name: Review modified files + run: git status - name: Upload VSIX uses: actions/upload-artifact@v4 with: From 14f1afbde83ac4e5c84872bb715954c28a37395d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 15:22:03 +0100 Subject: [PATCH 20/23] Add Verify VSIX Deploy settings --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 044fa166..dc3c5bf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ on: default: false required: true is_production_release: - description: 'is_production_release: Whether the release is a production release and not a pre-releaae (enabling this will update change log, increases version and tags commit)' + description: 'is_production_release: Whether the release is a production release and not a pre-release (enabling this will update change log, increases version and tags commit)' type: boolean default: false required: true @@ -246,6 +246,15 @@ jobs: name: vsix-v${{ needs.build.outputs.product_full_version }} path: release_packages + - name: Verify VSIX Deploy settings + shell: pwsh + run: | + Write-Output "Deploying v${{ needs.build.outputs.product_full_version }} (v${{ needs.build.outputs.product_main_version }}) package to Visual Studio Marketplace" + ls ${{ github.workspace }}/release_packages + $isProductionRelease = '${{ needs.build.outputs.is_production_release }}' -eq 'true' + if (-not $isProductionRelease) { + throw "Preview releases are currently not supported. (The 'is_production_release' must be set.)" + } # - name: Deploy VSIX packages # uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 # with: From 6dc94f1b1b0532022e6898fe051ddce498b63bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 15:25:45 +0100 Subject: [PATCH 21/23] updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 036fd792..15c6c2fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ *Added support for .NET 9 through the Visual Studio extension. -*Contributors of this release (in alphabetical order):* @UL-ChrisGlew +*Contributors of this release (in alphabetical order):* @gasparnagy, @UL-ChrisGlew # v2024.6.176 - 2024-11-08 From c4e999bb02f13ef539d38c7f3170c88f23ba667d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 15:33:40 +0100 Subject: [PATCH 22/23] undo temp changes --- .github/workflows/ci.yml | 71 ++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc3c5bf3..ca37e0d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,36 +200,36 @@ jobs: name: vsix-v${{ steps.versions.outputs.product_full_version }} if-no-files-found: error path: "Reqnroll.VisualStudio.Package/bin/${{ steps.versions.outputs.product_configuration }}/net481/*.vsix" - # - uses: nuget/setup-nuget@v1.2 - # - name: Prepare Connector Tests - # shell: pwsh - # run: | - # cd Tests/ExternalPackages - # ./buildExternalPackages.ps1 - # cd PackagesForTests - # nuget install packages.config - # - name: Connector Tests - # run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj ${{ steps.build_params.outputs.test_params }} - # - name: Connector V1 Tests - # run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj ${{ steps.build_params.outputs.test_params }} - # - name: Specs Tests - # run: > - # dotnet test ./Tests/Reqnroll.VisualStudio.Specs/Reqnroll.VisualStudio.Specs.csproj - # --filter "Category!=quarantine" - # ${{ steps.build_params.outputs.test_params }} - # - name: Upload Test Result TRX Files - # uses: actions/upload-artifact@v4 - # if: always() - # with: - # name: build-trx-v${{ steps.versions.outputs.product_full_version }} - # if-no-files-found: error - # path: "**/*.trx" + - uses: nuget/setup-nuget@v1.2 + - name: Prepare Connector Tests + shell: pwsh + run: | + cd Tests/ExternalPackages + ./buildExternalPackages.ps1 + cd PackagesForTests + nuget install packages.config + - name: Connector Tests + run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.Tests/Reqnroll.VisualStudio.ReqnrollConnector.Tests.csproj ${{ steps.build_params.outputs.test_params }} + - name: Connector V1 Tests + run: dotnet test ./Tests/Connector/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests/Reqnroll.VisualStudio.ReqnrollConnector.V1.Tests.csproj ${{ steps.build_params.outputs.test_params }} + - name: Specs Tests + run: > + dotnet test ./Tests/Reqnroll.VisualStudio.Specs/Reqnroll.VisualStudio.Specs.csproj + --filter "Category!=quarantine" + ${{ steps.build_params.outputs.test_params }} + - name: Upload Test Result TRX Files + uses: actions/upload-artifact@v4 + if: always() + with: + name: build-trx-v${{ steps.versions.outputs.product_full_version }} + if-no-files-found: error + path: "**/*.trx" release: runs-on: windows-latest needs: [build] environment: production_environment - # if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' + if: github.ref == 'refs/heads/main' && needs.build.outputs.deploy_packages == 'true' permissions: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. @@ -255,15 +255,16 @@ jobs: if (-not $isProductionRelease) { throw "Preview releases are currently not supported. (The 'is_production_release' must be set.)" } - # - name: Deploy VSIX packages - # uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 - # with: - # marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT }} - # publish-manifest-path: ${{ github.workspace }}/.marketplace/publishManifest.json - # vsix-path: ${{ github.workspace }}/release_packages/Reqnroll.VisualStudio.Package.v${{ needs.build.outputs.product_version_prefix }}.vsix + + - name: Deploy VSIX packages + uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 + with: + marketplace-pat: ${{ secrets.MARKETPLACE_PUBLISH_PAT }} + publish-manifest-path: ${{ github.workspace }}/.marketplace/publishManifest.json + vsix-path: ${{ github.workspace }}/release_packages/Reqnroll.VisualStudio.Package.v${{ needs.build.outputs.product_version_prefix }}.vsix - name: Calculate Next Version - # if: needs.build.outputs.is_production_release == 'true' + if: needs.build.outputs.is_production_release == 'true' id: next_version shell: pwsh run: | @@ -276,7 +277,7 @@ jobs: Write-Output "Product Next Main Version: $nextMainVersion" - name: Bump Version - # if: needs.build.outputs.is_production_release == 'true' + if: needs.build.outputs.is_production_release == 'true' shell: pwsh run: | [System.IO.File]::WriteAllText("Directory.Build.props", [System.IO.File]::ReadAllText("Directory.Build.props").Replace("<ReqnrollMainVersion>${{ needs.build.outputs.product_main_version }}</ReqnrollMainVersion>", "<ReqnrollMainVersion>${{ steps.next_version.outputs.product_next_main_version }}</ReqnrollMainVersion>")) @@ -286,7 +287,7 @@ jobs: } - name: Update Changelog - # if: needs.build.outputs.is_production_release == 'true' + if: needs.build.outputs.is_production_release == 'true' id: changelog shell: pwsh run: | @@ -307,7 +308,7 @@ jobs: Write-Output "release_notes_file=release_notes.txt" >> $env:GITHUB_OUTPUT - name: Update changes in GitHub repository - # if: needs.build.outputs.is_production_release == 'true' + if: needs.build.outputs.is_production_release == 'true' run: | git status git config --global user.name 'Reqnroll CI' From 54a447580ba660f585aadcde40e66e7d019d1c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1sp=C3=A1r=20Nagy?= <gaspar.nagy@gmail.com> Date: Wed, 20 Nov 2024 16:09:12 +0100 Subject: [PATCH 23/23] add RELEASING.md --- .vscode/settings.json | 3 ++- RELEASING.md | 50 +++++++++++++++++++++++++++++++++++++++ Reqnroll.VisualStudio.sln | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 RELEASING.md diff --git a/.vscode/settings.json b/.vscode/settings.json index 2bbfadf9..d7692fd8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ "Reqnroll" - ] + ], + "markdown.extension.toc.updateOnSave": false } \ No newline at end of file diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 00000000..0864de24 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,50 @@ +# Releasing + +This document describes how to make a release using GitHub Actions. + +There are two parts to making a release: + +* [Prepare the release](#prepare-the-release) +* [Make the release](#make-the-release) + +If you're making a major or minor release it is recommended to discuss it with the other contributors upfront (e.g. on Discord). + +## Prepare the release + +Anyone with permission to push to the `main` branch can prepare a release. + +1. Add new information to `CHANGELOG.md`. Ideally the `CHANGELOG.md` should be up-to-date, but sometimes there will be accidental omissions when merging PRs. + * Use `git log --format=format:"* %s (%an)" --reverse <last-version-tag>..HEAD` to list all commits since the last release. + * Add changelog details under the `# [vNext]` heading; the release process will update this heading when it makes the release +1. Check & update contributors list (if applicable) + * List recent contributors: + ``` + git log --format=format:"%an <%ae>" --reverse <last-version-tag>..HEAD | grep -vEi "(renovate|dependabot|Snyk)" | sort| uniq -i + ``` + * Update contributors if necessary at the `Contributors of this release` part of the `# [vNext]` heading +1. The Visual Studio extension releases are versioned sequentially within a year, with the format `YYYY.SEQ.BUILD` (e.g. `2024.5.182`). In the beginning of the year, the year number must be updated and the sequence number has to be reset to `1`. When preparing the release you just need to double-check if the version is correct. You can find the current version number in the `Directory.Build.props` file. + +## Make the release + +Only people in group [release-managers](https://github.com/orgs/reqnroll/teams/release-managers) can make releases and only from the `main` branch. + +### Making a preview release + +Making preview releases are currently not supported, but each build contains a deploy target with the `vsix` installation file included. Installing those could be used to test preview versions. + +### Making a production release + +Production releases (or just releases) are intended to use for any users. Their version number does not contain a version suffix. + +To release such a preview release, the following steps has to be done: + +1. Open the CI workflow at GitHub: https://github.com/reqnroll/Reqnroll.VisualStudio/actions/workflows/ci.yml +1. Choose the "Run workflow" button to trigger the release with the following settings: + * `deploy_packages`: checked + * `is_production_release`: checked + * `custom_version_suffix`: leave it empty + * `custom_configuration`: leave it on default +1. The CI workflow runs and ideally passes all core and testing jobs, but will stop for approval before running the `release` job. +1. Make sure everything is OK. You can even download the packages to be published for a smoke test if necessary. +1. If everything is fine, approve the deployment job. +1. The job will publish the packages, tag the current commit and create a new commit with the updated version number and changelog header. diff --git a/Reqnroll.VisualStudio.sln b/Reqnroll.VisualStudio.sln index 3ea7d675..f65faea5 100644 --- a/Reqnroll.VisualStudio.sln +++ b/Reqnroll.VisualStudio.sln @@ -57,6 +57,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{31ACD27E-7 Directory.Build.targets = Directory.Build.targets LICENSE = LICENSE README.md = README.md + RELEASING.md = RELEASING.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reqnroll.VisualStudio.UI.Tester", "Tests\Reqnroll.VisualStudio.UI.Tester\Reqnroll.VisualStudio.UI.Tester.csproj", "{2A412F65-68C7-4A5D-AFCF-74E928C40C21}"