Skip to content

Release serverless-init #100

Release serverless-init

Release serverless-init #100

name: Release serverless-init
on:
workflow_dispatch:
inputs:
buildTags:
type: choice
description: Build tags
default: "serverless otlp"
options:
- "serverless otlp"
- "serverless"
tag:
type: string
description: Docker image tag name, eg. (beta11, beta12-rc1, etc.)
latestTag:
type: choice
description: Additionally, tag this as latest? Only use this if releasing a new production version.
default: "no"
options:
- "yes"
- "no"
agentVersion:
type: string
description: Datadog agent version
agentBranch:
type: string
description: Datadog agent branch or tag name (default main)
default: "main"
env:
IMAGE_NAME: datadog/datadog-lambda-extension/serverless-init
REGISTRY: ghcr.io
jobs:
release-serverless-init:
runs-on: ubuntu-latest
strategy:
matrix:
arrays: [
{dockerFile: "Dockerfile.serverless-init.build", isAlpine: "false", tagSuffix: ""},
{dockerFile: "Dockerfile.serverless-init.alpine.build", isAlpine: "true", tagSuffix: "-alpine"}
]
name: "Release Serverless Init (isAlpine: ${{ matrix.arrays.isAlpine }})"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: DataDog/datadog-agent
ref: ${{ github.event.inputs.agentBranch }}
path: datadog-agent
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build binaries
working-directory: ./scripts
run: ./build_serverless_init.sh
env:
AGENT_PATH: datadog-agent
VERSION: ${{ github.event.inputs.tag }}
SERVERLESS_INIT: true
ALPINE: ${{ matrix.arrays.isAlpine }}
AGENT_VERSION: ${{ github.event.inputs.agentVersion }}
- name: Set up build directory and copy binaries
run: |
cp -r .layers/. ./scripts/bin/
- name: Set up tracer installation script
run: |
cp ./scripts/serverless_init_dotnet.sh ./scripts/bin/
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./scripts
file: ./scripts/${{ matrix.arrays.dockerFile }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}${{ matrix.arrays.tagSuffix }}
provenance: false
platforms: linux/amd64,linux/arm64
- name: Build and push latest
id: docker_build_latest
uses: docker/build-push-action@v6
if: ${{ github.event.inputs.latestTag == 'yes' }}
with:
context: ./scripts
file: ./scripts/${{ matrix.arrays.dockerFile }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest${{ matrix.arrays.tagSuffix }}
provenance: false
platforms: linux/amd64,linux/arm64