@@ -140,6 +140,7 @@ jobs:
140140 run : ls -laR distributions/otelcol-contrib/artifacts
141141
142142 - name : Run GoReleaser for ${{ inputs.distribution }}
143+ id : build-snapshot
143144 uses : goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
144145 with :
145146 distribution : goreleaser-pro
@@ -180,20 +181,30 @@ jobs:
180181 path : distributions/${{ inputs.distribution }}/dist/windows_amd64_v1/**/*.msi
181182 if-no-files-found : error
182183
183- # - name: Build container images locally
184- # uses: docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 # v6.14.0
185- # with:
186- # context: ./distributions/${{ inputs.distribution }}
187- # push: false
188- # load: true
189- # tags: ${{ inputs.distribution }}:SNAPSHOT-
190- #
191- # - name: export image to tar
192- # run: |
193- # docker save dynatrace-otel-collector:e2e-test > /tmp/dynatrace-otel-collector.tar
194- #
195- # - name: Upload container image artifact
196- # uses: actions/upload-artifact@v4
197- # with:
198- # name: dynatrace-otel-collector-image
199- # path: /tmp/dynatrace-otel-collector.tar
184+ - name : Build container images locally
185+ uses : docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 # v6.14.0
186+ env :
187+ VERSION : ${{ fromJSON(steps.build-snapshot.outputs.metadata).version }}
188+ ARCH : ${{ fromJSON(steps.build-snapshot.outputs.metadata).runtime.goos }}-${{ fromJSON(steps.build-snapshot.outputs.metadata).runtime.goarch }}
189+ with :
190+ context : ./distributions/${{ inputs.distribution }}
191+ push : false
192+ load : true
193+ tags : ${{ inputs.distribution }}:${{ env.VERSION }}-${{ env.ARCH }}
194+
195+ - name : Export container image to tarball
196+ env :
197+ VERSION : ${{ fromJSON(steps.build-snapshot.outputs.metadata).version }}
198+ ARCH : ${{ fromJSON(steps.build-snapshot.outputs.metadata).runtime.goos }}-${{ fromJSON(steps.build-snapshot.outputs.metadata).runtime.goarch }}
199+ run : |
200+ docker save ${{ inputs.distribution }}:${{ env.VERSION }}-${{ env.ARCH }} > /tmp/${{ inputs.distribution }}.tar
201+
202+ - name : Upload container image artifact
203+ uses : actions/upload-artifact@v4
204+ env :
205+ VERSION : ${{ fromJSON(steps.build-snapshot.outputs.metadata).version }}
206+ ARCH : ${{ fromJSON(steps.build-snapshot.outputs.metadata).runtime.goos }}-${{ fromJSON(steps.build-snapshot.outputs.metadata).runtime.goarch }}
207+ with :
208+ name : ${{ inputs.distribution }}-image-${{ env.VERSION }}-${{ env.ARCH }}
209+ path : /tmp/${{ inputs.distribution }}.tar
210+ retention-days : 7
0 commit comments