Skip to content

Prepare 0.20.0 release #1864

Prepare 0.20.0 release

Prepare 0.20.0 release #1864

Workflow file for this run

name: Build PR Snapshots
on:
pull_request:
branches: [main]
env:
# renovate: datasource=golang-version depName=go
GO_VERSION: "1.23.4"
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v3
- uses: anchore/sbom-action/[email protected]
- name: Cache tools
id: cache-tools
uses: actions/cache@v4
with:
path: .tools
key: snapshot-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
- name: Install tools
if: steps.cache-tools.outputs.cache-hit != 'true'
run: |
mkdir -p .tools
touch .tools/*
make install-tools
- name: Generate source files
run: make generate
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: snapshot-mods-${{ runner.os }}-${{ hashFiles('build/go.sum') }}
- name: Create Snapshot for Pull Request
run: make snapshot
- name: Upload Pull Request Preview
uses: actions/upload-artifact@v4
with:
name: otelcol_dynatrace_${{ github.event.pull_request.number }}_${{ github.run_number }}
path: dist/*
- name: Upload linux service packages
uses: actions/upload-artifact@v4
with:
name: linux-packages
path: |
dist/dynatrace-otel-collector_*_Linux_x86_64.deb
dist/dynatrace-otel-collector_*_Linux_x86_64.rpm
dist/dynatrace-otel-collector_*_Linux_arm64.deb
dist/dynatrace-otel-collector_*_Linux_arm64.rpm
dist/metadata.json
linux-package-tests:
name: Test Linux Packages
runs-on: ubuntu-24.04
needs: build
strategy:
matrix:
os: ["deb", "rpm"]
arch: ["x86_64", "arm64"]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v3
- name: Download linux service packages
uses: actions/download-artifact@v4
with:
name: linux-packages
path: linux-packages
- name: Parse metadata file
id: parse-metadata
run: |
metadata=`cat ./linux-packages/metadata.json`
echo "metadata=$metadata" >> "$GITHUB_OUTPUT"
- name: Extract version number
id: extract-version
run: echo "version=${{ fromJson(steps.parse-metadata.outputs.metadata).version }}" >> "$GITHUB_OUTPUT"
- name: Test
run: make package-test ARCH=${{ matrix.arch }} PACKAGE_PATH=linux-packages/dynatrace-otel-collector_${{ steps.extract-version.outputs.version }}_Linux_${{ matrix.arch }}.${{ matrix.os }}