From 789bc3ba1dde5c366a48e3b0c96857f0862fb673 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:47:09 +0000 Subject: [PATCH 1/2] Convert .vsts-ci pipelines to GitHub Actions workflows Agent-Logs-Url: https://github.com/PowerShell/PowerShell-Native/sessions/9c8610bf-c0c8-4313-aa87-7ff7c2e8facc Co-authored-by: adityapatwardhan <12820925+adityapatwardhan@users.noreply.github.com> --- .github/workflows/ci-linux.yml | 46 +++++++++++++++++++++ .github/workflows/ci-mac.yml | 44 ++++++++++++++++++++ .github/workflows/ci-windows.yml | 63 +++++++++++++++++++++++++++++ .github/workflows/misc-analysis.yml | 32 +++++++++++++++ 4 files changed, 185 insertions(+) create mode 100644 .github/workflows/ci-linux.yml create mode 100644 .github/workflows/ci-mac.yml create mode 100644 .github/workflows/ci-windows.yml create mode 100644 .github/workflows/misc-analysis.yml diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 0000000..95c2fd5 --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,46 @@ +# Converted from .vsts-ci/linux.yml +name: Linux CI + +on: + push: + branches: + - master + - release* + pull_request: + branches: + - master + - release* + +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + # Avoid expensive initialization of dotnet cli, see: http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + +defaults: + run: + shell: pwsh + +jobs: + build: + name: Linux - ${{ matrix.buildName }} + runs-on: ubuntu-latest + + strategy: + matrix: + buildName: + - ubuntu.16.04-arm + - ubuntu.16.04-arm64 + - centos.7 + - alpine + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + clean: true + + - name: Start build - ${{ matrix.buildName }} + if: success() + run: | + tools/releaseBuild/vstsBuild.ps1 -Name ${{ matrix.buildName }} -Verbose diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml new file mode 100644 index 0000000..76109f4 --- /dev/null +++ b/.github/workflows/ci-mac.yml @@ -0,0 +1,44 @@ +# Converted from .vsts-ci/mac.yml +name: macOS CI + +on: + push: + branches: + - master + - release* + pull_request: + branches: + - master + - release* + +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + # Avoid expensive initialization of dotnet cli, see: http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + +defaults: + run: + shell: pwsh + +jobs: + build: + name: Build + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + clean: true + + - name: Start build + run: | + tools/releaseBuild/PowershellNative.ps1 -Arch osx -Configuration Release -RepoRoot ${{ github.workspace }} -TargetLocation "${{ runner.temp }}/Packages" -Verbose + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + if: success() + with: + name: artifacts + path: ${{ runner.temp }}/Packages/osx-symbols.zip diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 0000000..8b78573 --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,63 @@ +# Converted from .vsts-ci/windows.yml +# Note: The original pipeline used a self-hosted Azure DevOps pool (PS-PowerShell-x64) +# with a custom image (PSMMS2019-PS-Native-Secure). Update the runs-on value +# to a self-hosted runner label if one is available. +name: Windows CI + +on: + push: + branches: + - master + - release* + pull_request: + branches: + - master + - release* + +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + # Avoid expensive initialization of dotnet cli, see: http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + +defaults: + run: + shell: pwsh + +jobs: + build: + name: Windows - ${{ matrix.buildName }} + runs-on: windows-latest + + strategy: + matrix: + include: + - buildName: x86 + - buildName: x64 + - buildName: x64_arm64 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + clean: true + + - name: Set Visual Studio Path + if: success() + run: | + $vsPath = ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin' + "$vsPath" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 + + - name: Start build - ${{ matrix.buildName }} + if: success() + run: | + $cmakeBinPath = "$env:ProgramFiles\CMake\bin\" + if(Test-Path $cmakeBinPath) { $env:Path = "$cmakeBinPath;$env:PATH" } else { throw "CMake not installed under $cmakeBinPath" } + ${{ github.workspace }}\tools\releaseBuild\PowerShellNative.ps1 -RepoRoot ${{ github.workspace }} -TargetLocation "${{ runner.temp }}\Packages" -Arch ${{ matrix.buildName }} -Configuration Release -Symbols + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + if: success() + with: + name: artifacts-${{ matrix.buildName }} + path: ${{ runner.temp }}\Packages\${{ matrix.buildName }}-symbols.zip diff --git a/.github/workflows/misc-analysis.yml b/.github/workflows/misc-analysis.yml new file mode 100644 index 0000000..fc4ea72 --- /dev/null +++ b/.github/workflows/misc-analysis.yml @@ -0,0 +1,32 @@ +# Converted from .vsts-ci/misc-analysis.yml +# Note: The original pipeline used a private Azure DevOps compliance template +# (ci-compliance.yml@ComplianceRepo from PowerShell/compliance). That template +# is not available as a GitHub Actions workflow. The checkout steps are preserved +# and the compliance step is noted below for manual replacement. +name: Misc Analysis + +on: + push: + # Batch merge builds together while a merge build is running + branches: + - master + - release* + pull_request: + branches: + - master + - release* + +jobs: + compliance: + name: Compliance Job + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + clean: true + + # The original pipeline ran the ci-compliance.yml template from the + # PowerShell/compliance Azure DevOps repository. Replace this step with + # the appropriate GitHub Actions compliance checks for your organization. From 5120f8886eec1066f414e59d7e57114b660c3d7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:48:37 +0000 Subject: [PATCH 2/2] Add permissions: contents: read to all converted CI workflows Agent-Logs-Url: https://github.com/PowerShell/PowerShell-Native/sessions/9c8610bf-c0c8-4313-aa87-7ff7c2e8facc Co-authored-by: adityapatwardhan <12820925+adityapatwardhan@users.noreply.github.com> --- .github/workflows/ci-linux.yml | 3 +++ .github/workflows/ci-mac.yml | 3 +++ .github/workflows/ci-windows.yml | 3 +++ .github/workflows/misc-analysis.yml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 95c2fd5..5ccc510 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -21,6 +21,9 @@ defaults: run: shell: pwsh +permissions: + contents: read + jobs: build: name: Linux - ${{ matrix.buildName }} diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index 76109f4..d68b1e2 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -21,6 +21,9 @@ defaults: run: shell: pwsh +permissions: + contents: read + jobs: build: name: Build diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 8b78573..3c5035d 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -24,6 +24,9 @@ defaults: run: shell: pwsh +permissions: + contents: read + jobs: build: name: Windows - ${{ matrix.buildName }} diff --git a/.github/workflows/misc-analysis.yml b/.github/workflows/misc-analysis.yml index fc4ea72..4468bcd 100644 --- a/.github/workflows/misc-analysis.yml +++ b/.github/workflows/misc-analysis.yml @@ -16,6 +16,9 @@ on: - master - release* +permissions: + contents: read + jobs: compliance: name: Compliance Job