Skip to content

Fix reversinglabs scan GitHub action (#64) #39

Fix reversinglabs scan GitHub action (#64)

Fix reversinglabs scan GitHub action (#64) #39

name: "Release Staging Collector Lambda layer"
on:
# (Using tag push instead of release to allow filtering by tag prefix.)
push:
tags:
- layer-staging-collector/**
permissions:
contents: read
jobs:
build-layer:
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
- x86_64
- arm64
outputs:
COLLECTOR_VERSION: ${{ steps.save-collector-version.outputs.COLLECTOR_VERSION }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: collector/go.mod
- name: set version to the default config.yaml
run: |
version=$(echo ${{ github.ref_name }} | awk -F'/' {'print $2'})
sed -i "s/0.0.0-dev/$version/g" collector/config.yaml
- name: cat collector/config.yaml
run: cat collector/config.yaml
- name: build
run: make -C collector package GOARCH=${{ matrix.architecture == 'x86_64' && 'amd64' || 'arm64' }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: opentelemetry-collector-layer-${{ matrix.architecture }}.zip
path: ${{ github.workspace }}/collector/build/opentelemetry-collector-layer-${{ matrix.architecture }}.zip
- name: Save Collector Version
if: ${{ matrix.architecture == 'x86_64' }}
id: save-collector-version
shell: bash
# `./collector -v` output is in the form `v0.75.0`
run: |
COLLECTOR_VERSION=$( ${{ github.workspace }}/collector/build/extensions/collector -v)
echo "COLLECTOR_VERSION=$COLLECTOR_VERSION" >> $GITHUB_OUTPUT
scan:
permissions:
contents: read
id-token: write
uses: ./.github/workflows/reversinglabs.yml
needs: build-layer
strategy:
matrix:
architecture:
- x86_64
- arm64
with:
artifact-name: opentelemetry-collector-layer-${{ matrix.architecture }}.zip
secrets: inherit
publish-layer:
permissions: # required by the reusable workflow
contents: read
id-token: write
uses: ./.github/workflows/layer-publish.yml
needs: build-layer
strategy:
matrix:
architecture:
- x86_64
- arm64
aws_region:
- ap-northeast-1
- ap-northeast-2
- ap-south-1
- ap-southeast-1
- ap-southeast-2
- ca-central-1
- eu-central-1
- eu-north-1
- eu-west-1
- eu-west-2
- eu-west-3
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
with:
artifact-name: opentelemetry-collector-layer-${{ matrix.architecture }}.zip
layer-name: opentelemetry-collector
component-version: ${{needs.build-layer.outputs.COLLECTOR_VERSION}}
architecture: ${{ matrix.architecture }}
release-group: staging
aws_region: ${{ matrix.aws_region }}
secrets: inherit