2121 matrix :
2222 include :
2323 - os : windows-latest
24- - os : macos-latest
2524 - os : ubuntu-latest
2625
2726 steps :
4039 if : runner.os == 'Windows'
4140 run : .\build.cmd
4241
43- - name : Build on macOS
44- if : runner.os == 'macOS'
45- run : bash build.sh
46-
4742 - name : Test on Linux
4843 if : runner.os == 'Linux'
4944 run : dotnet test
5247 if : runner.os == 'Windows'
5348 run : dotnet test
5449
55- - name : Test on macOS
56- if : runner.os == 'macOS'
57- run : dotnet test
58-
5950 - name : Upload Artifact on X64 Linux
6051 if : runner.os == 'Linux'
6152 uses : actions/upload-artifact@v3
6960 with :
7061 name : aws-distro-opentelemetry-dotnet-instrumentation-windows
7162 path : bin/aws-distro-opentelemetry-dotnet-instrumentation-windows.zip
72-
73- - name : Upload Artifact on macOS
74- if : runner.os == 'macOS'
75- uses : actions/upload-artifact@v3
76- with :
77- name : aws-distro-opentelemetry-dotnet-instrumentation-macOS
78- path : bin/aws-distro-opentelemetry-dotnet-instrumentation-macos.zip
79-
80- build-arm :
81- runs-on : codebuild-adot-dotnet-runner-${{ github.run_id }}-${{ github.run_attempt }}
82- steps :
83- - uses : actions/checkout@v3
84-
85- - name : Setup .NET
86- uses : actions/setup-dotnet@v2
87- with :
88- dotnet-version : ' 8.0.x'
89-
90- - name : Build on Linux
91- run : bash build.sh
92-
93- - name : Test on Linux
94- run : dotnet test
95-
96- - name : Upload Artifact on ARM Linux
97- uses : actions/upload-artifact@v3
98- with :
99- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-arm64
100- path : bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip
10163
10264 build-x64-musl :
10365 runs-on : ubuntu-latest
@@ -119,27 +81,6 @@ jobs:
11981 with :
12082 name : aws-distro-opentelemetry-dotnet-instrumentation-linux-x64-musl
12183 path : bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-x64.zip
122-
123- build-arm-musl :
124- runs-on : codebuild-adot-dotnet-runner-${{ github.run_id }}-${{ github.run_attempt }}
125- steps :
126- - name : Checkout
127- 128- with :
129- fetch-depth : 0
130-
131- - name : Build in Docker container
132- run : |
133- set -e
134- docker build -t mybuildimage -f "./docker/alpine.dockerfile" ./docker
135- docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
136- /bin/sh -c 'git config --global --add safe.directory /project && dotnet test && ./build.sh'
137-
138- - name : Upload Artifact on MUSL ARM Linux
139- uses : actions/upload-artifact@v3
140- with :
141- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-arm64-musl
142- path : bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-arm64.zip
14384
14485 # dotnet-e2e-ec2-default-test:
14586 # needs: [build]
@@ -165,213 +106,4 @@ jobs:
165106 # with:
166107 # aws-region: ${{ matrix.aws-region }}
167108 # caller-workflow-name: 'main-build'
168- # staging_wheel_name: 'aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip'
169-
170-
171- release :
172- if : startsWith(github.ref, 'refs/heads/main')
173- needs : [build, build-arm, build-x64-musl, build-arm-musl, dotnet-e2e-ec2-default-test]
174- runs-on : ubuntu-latest
175- steps :
176- - uses : actions/checkout@v3
177-
178- - name : Download Linux x64 Artifact
179- uses : actions/download-artifact@v3
180- with :
181- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip
182- path : ./artifacts/linux/x64
183-
184- - name : Download Windows Artifact
185- uses : actions/download-artifact@v3
186- with :
187- name : aws-distro-opentelemetry-dotnet-instrumentation-windows
188- path : ./artifacts/windows
189-
190- - name : Download macOS Artifact
191- uses : actions/download-artifact@v3
192- with :
193- name : aws-distro-opentelemetry-dotnet-instrumentation-macOS
194- path : ./artifacts/macOS
195-
196-
197- - name : Download Linux ARM Artifact
198- uses : actions/download-artifact@v3
199- with :
200- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-arm64
201- path : ./artifacts/linux/arm64
202-
203- - name : Download Linux ARM MUSL Artifact
204- uses : actions/download-artifact@v3
205- with :
206- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-arm64-musl
207- path : ./artifacts/linux/arm64-musl
208-
209- - name : Download Linux X64 MUSL Artifact
210- uses : actions/download-artifact@v3
211- with :
212- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-x64-musl
213- path : ./artifacts/linux/x64-musl
214-
215- - name : Get Commit ID
216- id : get_commit
217- run : |
218- short_commit_id=$(echo ${GITHUB_SHA} | cut -c1-7)
219- echo "::set-output name=commit_id::${short_commit_id}"
220-
221- - name : Create GH release
222- id : create_release
223- env :
224- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
225- run : |
226- gh release create main-build-${{steps.get_commit.outputs.commit_id}}-pre-release \
227- --target "$GITHUB_REF_NAME" \
228- --title "Main Build Pre-Release Commit ${{ steps.get_commit.outputs.commit_id }}" \
229- --notes "Release and Pre-Release from Main build"
230-
231- - name : Upload Linux x64 Artifact to Release
232- env :
233- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
234- run : |
235- gh release upload "main-build-${{steps.get_commit.outputs.commit_id}}-pre-release" \
236- ./artifacts/linux/x64/*.zip \
237- --clobber
238-
239- - name : Upload Windows Artifact to Release
240- env :
241- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
242- run : |
243- gh release upload "main-build-${{steps.get_commit.outputs.commit_id}}-pre-release" \
244- ./artifacts/windows/*.zip \
245- --clobber
246-
247- - name : Upload macOS Artifact to Release
248- env :
249- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
250- run : |
251- gh release upload "main-build-${{steps.get_commit.outputs.commit_id}}-pre-release" \
252- ./artifacts/macOS/*.zip \
253- --clobber
254-
255- - name : Upload Linux ARM Artifact to Release
256- env :
257- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
258- run : |
259- gh release upload "main-build-${{steps.get_commit.outputs.commit_id}}-pre-release" \
260- ./artifacts/linux/arm64/*.zip \
261- --clobber
262-
263- - name : Upload Linux ARM MUSL Artifact to Release
264- env :
265- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
266- run : |
267- gh release upload "main-build-${{steps.get_commit.outputs.commit_id}}-pre-release" \
268- ./artifacts/linux/arm64-musl/*.zip \
269- --clobber
270-
271- - name : Upload Linux X64 MUSL Artifact to Release
272- env :
273- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
274- run : |
275- gh release upload "main-build-${{steps.get_commit.outputs.commit_id}}-pre-release" \
276- ./artifacts/linux/x64-musl/*.zip \
277- --clobber
278-
279- build-image :
280- needs : [build, build-x64-musl]
281- runs-on : ${{ matrix.os }}
282- strategy :
283- matrix :
284- include :
285- - os : windows-2022
286- - os : windows-2019
287- - os : ubuntu-latest
288- steps :
289- - uses : actions/checkout@v3
290-
291- - name : Download Linux x64 Artifact
292- if : runner.os == 'Linux'
293- uses : actions/download-artifact@v3
294- with :
295- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip
296- path : ./artifacts/linux/x64
297-
298- - name : Download Linux X64 MUSL Artifact
299- if : runner.os == 'Linux'
300- uses : actions/download-artifact@v3
301- with :
302- name : aws-distro-opentelemetry-dotnet-instrumentation-linux-x64-musl
303- path : ./artifacts/linux/x64-musl
304-
305- - name : Unzip Linux Artifact
306- if : runner.os == 'Linux'
307- run : |
308- unzip ./artifacts/linux/x64/*.zip -d ./OpenTelemetryDistribution
309- unzip ./artifacts/linux/x64-musl/*.zip "linux-musl-x64/*" -d ./OpenTelemetryDistribution
310-
311- - name : Download Windows Artifact
312- if : runner.os == 'Windows'
313- uses : actions/download-artifact@v3
314- with :
315- name : aws-distro-opentelemetry-dotnet-instrumentation-windows
316- path : ./artifacts/windows
317-
318- - name : Unzip Windows Artifact
319- if : runner.os == 'Windows'
320- run : |
321- Expand-Archive -LiteralPath .\artifacts\windows\aws-distro-opentelemetry-dotnet-instrumentation-windows.zip -DestinationPath .\OpenTelemetryDistribution -Force
322- shell : powershell
323-
324- - name : Configure AWS Credentials
325- uses : aws-actions/configure-aws-credentials@v2
326- with :
327- role-to-assume : ${{ secrets.AWS_ASSUME_ROLE_ARN }}
328- aws-region : ${{ vars.AWS_DEFAULT_REGION }}
329-
330- - name : Login to Amazon ECR
331- id : login-ecr
332- uses : aws-actions/amazon-ecr-login@v2
333-
334- - name : Build Linux container
335- if : runner.os == 'Linux'
336- run : |
337- set -e
338- docker build -t ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:linux -f ./Dockerfile.linux .
339- docker push ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:linux
340-
341- - name : Build Windows container
342- if : runner.os == 'Windows'
343- run : |
344- $osInfo = systeminfo | Select-String "OS Version"
345- if ($osInfo -match "10.0.17763") {
346- Echo "Build image for Windows Server 2019"
347- docker build -t ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:windows2019 -f ./Dockerfile.windows2019 .
348- docker push ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:windows2019
349- } elseif ($osInfo -match "10.0.20348") {
350- Echo "Build image for Windows Server 2022"
351- docker build -t ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:windows2022 -f ./Dockerfile.windows2022 .
352- docker push ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:windows2022
353- } else {
354- Echo "Unknown Windows Server version: $osInfo"
355- exit 1
356- }
357- shell : powershell
358-
359- build-multi-platform-image :
360- needs : [build-image]
361- runs-on : ubuntu-latest
362- steps :
363- - name : Configure AWS Credentials
364- uses : aws-actions/configure-aws-credentials@v2
365- with :
366- role-to-assume : ${{ secrets.AWS_ASSUME_ROLE_ARN }}
367- aws-region : ${{ vars.AWS_DEFAULT_REGION }}
368-
369- - name : Login to Amazon ECR
370- id : login-ecr
371- uses : aws-actions/amazon-ecr-login@v2
372-
373- - name : Create multi-platform image and push to Amazon ECR
374- run : |
375- docker manifest create ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:${{ vars.DEV_VERSION_TAG }} ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:linux ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:windows2019 ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:windows2022
376- docker manifest inspect ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:${{ vars.DEV_VERSION_TAG }}
377- docker manifest push ${{ vars.STAGING_ECR_REGISTRY }}/${{ vars.STAGING_ECR_REPOSITORY }}:${{ vars.DEV_VERSION_TAG }}
109+ # staging_wheel_name: 'aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip'
0 commit comments