From 34a1895eee0a9cf1830f384a07be25aff32fb5d9 Mon Sep 17 00:00:00 2001 From: Zhiyuan Liang <141655842+zhiyuanliang-ms@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:50:59 +0800 Subject: [PATCH 1/2] version bump 3.5.0 (#475) --- .../Microsoft.FeatureManagement.AspNetCore.csproj | 2 +- .../Microsoft.FeatureManagement.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj b/src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj index 7e6b3226..c14d391f 100644 --- a/src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj +++ b/src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj @@ -4,7 +4,7 @@ 3 - 4 + 5 0 diff --git a/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj b/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj index 95e64f26..62e3ed9d 100644 --- a/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj +++ b/src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj @@ -4,7 +4,7 @@ 3 - 4 + 5 0 From de9eeed4f0149eff1613fdf284b934ddab09657f Mon Sep 17 00:00:00 2001 From: Amer Jusupovic <32405726+amerjusupovic@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:29:53 -0700 Subject: [PATCH 2/2] Use GitHub workflow for PR builds (#481) * add github workflow ci.yml, remove old pipelines * test workflow failure * revert test --- .github/workflows/ci.yml | 53 +++++++++ .pipelines/OneBranch.Official.yml | 175 ------------------------------ .pipelines/windows-buddy.yml | 125 --------------------- 3 files changed, 53 insertions(+), 300 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .pipelines/OneBranch.Official.yml delete mode 100644 .pipelines/windows-buddy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..3701da6c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: FeatureManagement-Dotnet CI + +on: + push: + branches: + - main + - preview + - release/* + pull_request: + branches: + - main + - preview + - release/* + +permissions: + security-events: write + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install .NET + run: pwsh build/install-dotnet.ps1 -RestoreOnly + + - name: Restore + run: pwsh build.ps1 -RestoreOnly + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: 'csharp' + + - name: Dotnet Build + run: pwsh build.ps1 + + - name: Dotnet Pack + run: pwsh pack.ps1 + + - name: Dotnet Test + run: pwsh test.ps1 + + - name: Publish Test Results + uses: actions/upload-artifact@v4 + with: + name: Unit Test Results + path: ${{ github.workspace }}/tests/**/*.trx + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.pipelines/OneBranch.Official.yml b/.pipelines/OneBranch.Official.yml deleted file mode 100644 index 15c44d0e..00000000 --- a/.pipelines/OneBranch.Official.yml +++ /dev/null @@ -1,175 +0,0 @@ -trigger: none - -parameters: # parameters are shown up in ADO UI in a build queue time -- name: 'debug' - displayName: 'Enable debug output' - type: boolean - default: false - -variables: - CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task - system.debug: ${{ parameters.debug }} - ENABLE_PRS_DELAYSIGN: 1 - ROOT: $(Build.SourcesDirectory) - REPOROOT: $(Build.SourcesDirectory) - OUTPUTROOT: $(REPOROOT)\out - CDP_USER_SOURCE_FOLDER_CONTAINER_PATH: $(Build.SourcesDirectory) - CDP_DEFINITION_BUILD_COUNT_DAY: $[counter(format('{0:yyyyMMdd}', pipeline.startTime), 1)] - CDP_DEFINITION_BUILD_COUNT_MONTH: $[counter(format('{0:yyyyMM}', pipeline.startTime), 1)] - CDP_DEFINITION_BUILD_COUNT_YEAR: $[counter(format('{0:yyyy}', pipeline.startTime), 1)] - NUGET_XMLDOC_MODE: none - - # Docker image which is used to build the project - WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2019/vse2022:latest' - -resources: - repositories: - - repository: templates - type: git - name: OneBranch.Pipelines/GovernedTemplates - ref: refs/heads/main - -extends: - template: v2/OneBranch.Official.CrossPlat.yml@templates - parameters: - cloudvault: - enabled: false - globalSdl: - tsa: - enabled: false # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode. - # credscan: - # suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppressions.json - binskim: - break: true # always break the build on binskim issues in addition to TSA upload - policheck: - break: true # always break the build on policheck issues. You can disable it by setting to 'false' - # baseline: - # baselineFile: $(Build.SourcesDirectory)\.gdn\global.gdnbaselines - cg: - failOnAlert: false - - stages: - - stage: build - jobs: - - job: main - pool: - type: windows - - variables: - ob_outputDirectory: '$(REPOROOT)\out' # this directory is uploaded to pipeline artifacts, reddog and cloudvault - ob_sdl_binskim_break: true - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}: # conditionally enable symbolsPublishing for master branch only - ob_symbolsPublishing_enabled: true - # ob_sdl_baseline_baselineFile: $(Build.SourcesDirectory)\.gdn\build.official.gdnbaselines - # ob_sdl_codeSignValidation_excludes: -|**\*.js # Example -|**\*.js;-|**\Test*\** - ob_artifactBaseName: 'drop' - ob_sdl_cg_failOnAlert: false - - steps: - - task: CmdLine@2 - displayName: 'Install .NET' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd build/install-dotnet.ps1 -RestoreOnly - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CmdLine@2 - displayName: 'Restore' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd build.ps1 -RestoreOnly - workingDirectory: '$(Build.SourcesDirectory)' - - - task: onebranch.pipeline.version@1 # generates automatic version - displayName: 'Setup BuildNumber' - inputs: - system: 'BuildRevision' - major: '1' - minor: '0' - name: 'FeatureManagement-Dotnet' - # exclude_commit: true - - - - - task: CmdLine@2 - displayName: 'Dotnet Build' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd build.ps1 - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\buildlogs' - Contents: | - **/* - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\build\Build Logs' - - - - - task: onebranch.pipeline.signing@1 - displayName: 'Signing' - inputs: - command: 'sign' - signing_environment: 'azure-ado' - signing_profile: 'external_distribution ' - files_to_sign: '*/bin/Release/**/*' - search_root: '$(Build.SourcesDirectory)\src' - - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\src' - Contents: | - */bin/Release/**/* - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\build\Binaries' - - - task: CmdLine@2 - displayName: 'Dotnet Pack' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd pack.ps1 - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\buildlogs' - Contents: | - **/* - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\package\Build Logs' - - - - - task: onebranch.pipeline.signing@1 - displayName: 'Signing' - inputs: - command: 'sign' - signing_environment: 'azure-ado' - signing_profile: 'external_distribution ' - files_to_sign: '*/bin/PackageOutput/**/*.nupkg' - search_root: '$(Build.SourcesDirectory)\src' - - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\src' - Contents: | - */bin/PackageOutput/**/*.nupkg - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\package\Packages' - - - task: CmdLine@2 - displayName: 'Dotnet Test' - inputs: - script: '$(Build.SourcesDirectory)\build/CallPowerShell.cmd test.ps1|| exit /b 0' - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\tests' - Contents: '**/*.trx' - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\test\_post_command__run_log_alerts_schedular_tests\_testresults' - - - task: PublishTestResults@2 - displayName: 'Unit Tests' - inputs: - testResultsFormat: 'vstest' - testResultsFiles: '**/*.trx' - searchFolder: '' - failTaskOnFailedTests: False - testRunTitle: Unit Tests \ No newline at end of file diff --git a/.pipelines/windows-buddy.yml b/.pipelines/windows-buddy.yml deleted file mode 100644 index 48e9a699..00000000 --- a/.pipelines/windows-buddy.yml +++ /dev/null @@ -1,125 +0,0 @@ - -pr: -- main -- release/* - -trigger: -- none - -parameters: # parameters are shown up in ADO UI in a build queue time -- name: 'debug' - displayName: 'Enable debug output' - type: boolean - default: false - -jobs: -- job: main - pool: - type: windows - isCustom: true - name: Azure Pipelines - vmImage: 'windows-latest' - - variables: - Codeql.Enabled: true - - steps: - - task: AntiMalware@4 - inputs: - InputType: 'Basic' - ScanType: 'CustomScan' - FileDirPath: '$(Build.StagingDirectory)' - TreatSignatureUpdateFailureAs: 'Warning' - SignatureFreshness: 'UpToDate' - TreatStaleSignatureAs: 'Error' - - - task: CredScan@3 - - - task: nuget-security-analysis@0 - - - task: CmdLine@2 - displayName: 'Install .NET' - inputs: - script: build\CallPowerShell.cmd build/install-dotnet.ps1 -RestoreOnly - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CmdLine@2 - displayName: 'Restore' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd build.ps1 -RestoreOnly - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CodeQL3000Init@0 - displayName: 'Initialize CodeQL' - - - task: CmdLine@2 - displayName: 'Dotnet Build' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd build.ps1 - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\buildlogs' - Contents: | - **/* - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\build\Build Logs' - - - task: CmdLine@2 - displayName: 'Dotnet Pack' - inputs: - script: $(Build.SourcesDirectory)\build\CallPowerShell.cmd pack.ps1 - workingDirectory: '$(Build.SourcesDirectory)' - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\buildlogs' - Contents: | - **/* - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\package\Build Logs' - - - task: CmdLine@2 - displayName: 'Dotnet Test' - inputs: - script: '$(Build.SourcesDirectory)\build/CallPowerShell.cmd test.ps1|| exit /b 0' - workingDirectory: '$(Build.SourcesDirectory)' - - - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)\tests' - Contents: '**/*.trx' - TargetFolder: '$(Build.SourcesDirectory)\out\outputs\test\_post_command__run_log_alerts_schedular_tests\_testresults' - - - task: PublishTestResults@2 - displayName: 'Unit Tests' - inputs: - testResultsFormat: 'vstest' - testResultsFiles: '**/*.trx' - searchFolder: '' - failTaskOnFailedTests: True - testRunTitle: Unit Tests - - - task: ComponentGovernanceComponentDetection@0 - displayName: "Component Detection" - inputs: - scanType: 'Register' - verbosity: 'Verbose' - alertWarningLevel: 'High' - - - task: BinSkim@4 - inputs: - InputType: 'Basic' - Function: 'analyze' - TargetPattern: 'guardianGlob' - AnalyzeTargetGlob: '$(Build.SourcesDirectory)\**.dll;$(Build.SourcesDirectory)\**.exe;' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish Artifacts' - inputs: - targetPath: '$(Build.SourcesDirectory)\out\outputs' - artifact: 'drop' - publishLocation: 'pipeline' - - - task: CodeQL3000Finalize@0 - displayName: 'Finalize CodeQL'