Release serverless-init #256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release serverless-init | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| buildTags: | |
| type: choice | |
| description: Build tags | |
| default: "serverless otlp zlib zstd" | |
| options: | |
| - "serverless otlp zlib zstd" | |
| - "serverless zlib zstd" | |
| 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-22.04 | |
| permissions: | |
| packages: write | |
| 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: DataDog/datadog-agent | |
| ref: ${{ github.event.inputs.agentBranch }} | |
| path: datadog-agent | |
| # Pin QEMU to a known-good version. The default (binfmt:latest) has broken | |
| # arm64 emulation multiple times due to QEMU segfaults in libc-bin triggers: | |
| # - Feb 2025: qemu-v9.2.0 — PR #571 pinned, PR #581 reverted to :latest | |
| # - Mar 2026: qemu-v10.2.1 — binfmt:latest updated Feb 18, broke builds | |
| # See .github/workflows/test-qemu-versions.yml to sweep versions before | |
| # bumping this pin. A sweep pass is necessary but not sufficient — always | |
| # verify with a real build, as some failures are load-dependent. | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a #v4.0.0 | |
| with: | |
| image: tonistiigi/binfmt:qemu-v10.1.3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - 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@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: docker_build | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| 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@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| 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 |