Skip to content

Updated (#73)

Updated (#73) #42

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:
fail-fast: false
matrix:
architecture:
- x86_64
- arm64
outputs:
COLLECTOR_VERSION: ${{ steps.save-collector-version.outputs.COLLECTOR_VERSION }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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:
- af-south-1
- ap-east-1
- ap-east-2
- ap-northeast-1
- ap-northeast-2
- ap-south-1
- ap-south-2
- ap-southeast-1
- ap-southeast-2
- ap-southeast-3
- ap-southeast-4
- ap-southeast-5
- ap-southeast-6
- ap-southeast-7
- ca-central-1
- ca-west-1
- eu-central-1
- eu-central-2
- eu-north-1
- eu-south-1
- eu-south-2
- eu-west-1
- eu-west-2
- eu-west-3
- il-central-1
- me-central-1
- me-south-1
- mx-central-1
- 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