Skip to content

Reuse managed windows artifacts in release#5002

Merged
Kielek merged 8 commits into
open-telemetry:mainfrom
iskiselev:artifact-normalize
Apr 22, 2026
Merged

Reuse managed windows artifacts in release#5002
Kielek merged 8 commits into
open-telemetry:mainfrom
iskiselev:artifact-normalize

Conversation

@iskiselev
Copy link
Copy Markdown
Contributor

@iskiselev iskiselev commented Apr 16, 2026

Why

Fixes #4520

What

All non-windows build after compilation replace /net folder from windows compilation - so we still validate that build on all systems not broken, but test prepared artifacts - using same model as profiler replace on ubuntu build.
Done on top of #5005. Main change in 89b346d.

Checklist

- [ ] CHANGELOG.md is updated.
- [ ] Documentation is updated.
- [ ] New features are covered by tests.

@iskiselev iskiselev changed the title Reuse managed windows artifacts in release. Fix #4520 Reuse managed windows artifacts in release Apr 16, 2026
Unify container and non-container build to use same actions
with custom actions to hide the difference
@iskiselev iskiselev mentioned this pull request Apr 18, 2026
@iskiselev iskiselev force-pushed the artifact-normalize branch from c2c320a to 89b346d Compare April 18, 2026 06:18
SdkVersionAnalyzer scan actions in addition to workflow
Restrict non-literal argument for actions/setup-dotnet
Yaml modification now replace only required block, not touching other part of file
Docker file does not force dotnet 8 base.
@iskiselev iskiselev marked this pull request as ready for review April 18, 2026 08:10
@iskiselev iskiselev requested a review from a team as a code owner April 18, 2026 08:10
@iskiselev iskiselev force-pushed the artifact-normalize branch from f219355 to f0df27e Compare April 21, 2026 05:49
- name: Replace target paths from artifacts
if: ${{ inputs.replace-artifacts != '' }}
shell: pwsh
run: '& "${{ github.action_path }}/replace-build-artifacts.ps1"'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use environment variables such as ${env:GITHUB_ACTION_PATH} is preferable to interpolation as it removes any possibility of shell injection and makes it easier to copy-paste snippets to terminals for testing.

Comment on lines +16 to +35
- name: Validate cleanup inputs
shell: pwsh
run: |
$environmentType = '${{ inputs.environment-type }}'
$containerName = '${{ inputs.container-name }}'

if ($environmentType -notin @('host', 'container')) {
throw "environment-type must be either 'host' or 'container'."
}

if ($environmentType -eq 'container' -and [string]::IsNullOrEmpty($containerName)) {
throw 'container-name input is required when environment-type is container.'
}

- name: Stop build container
if: ${{ inputs.environment-type == 'container' && inputs.container-name != '' }}
shell: bash
run: |
set -u
docker rm -f "${{ inputs.container-name }}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with interpolation. Either assign them to env vars and use those, or maybe they'll be available already as ${env:INPUT_NAME} like ${env:INPUT_ENVIRONMENT-TYPE} (I can't remember if that's a thing or not).

}

- name: Stop build container
if: ${{ inputs.environment-type == 'container' && inputs.container-name != '' }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${{ and }} isn't needed for if:.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments around interpolation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments around interpolation.

$sourceRoot = [System.IO.Path]::GetFullPath((Join-Path $workspaceRoot 'bin/ci-artifacts/replacements'))
$targetRoot = [System.IO.Path]::GetFullPath((Join-Path $workspaceRoot $env:TARGET_ROOT))

function Test-IsUnderRoot {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Path.IsPathRooted() available to the PowerShell version on the runners?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments around interpolation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments around interpolation.

artifact-name: windows-2022
runner: windows-2022
environment-type: host
log-directory: /c/ProgramData/OpenTelemetry .NET AutoInstrumentation/logs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a Windows form of path?

Comment thread .github/workflows/ci.yml
set -e
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" .
docker run -e OS_TYPE=${{ matrix.os-type }} --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
docker run -e HOME=/tmp -e OS_TYPE=${{ matrix.os-type }} --user "$(id -u):$(id -g)" --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments around interpolation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CI/release build matrix so non-Windows builds replace the net managed artifacts with those produced by the Windows build, aiming to make managed binaries consistent across distributions (per #4520).

Changes:

  • Add bin-windows-2022!net to replace-artifacts for non-Windows matrix entries.
  • Ensure the reusable _build.yml workflow receives the replace-artifacts input for each matrix job (already wired; now exercised more broadly).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml
@Kielek
Copy link
Copy Markdown
Member

Kielek commented Apr 22, 2026

@martincostello, thanks for the review. We will track improvements on #5011. Merging in current state as other changes are already on main.

@Kielek Kielek merged commit c35551f into open-telemetry:main Apr 22, 2026
132 of 134 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binaries different in different distributions

5 participants