Skip to content

chore: update OpenTelemetry version mappings (v0.150.1) #17

chore: update OpenTelemetry version mappings (v0.150.1)

chore: update OpenTelemetry version mappings (v0.150.1) #17

Workflow file for this run

# Build and test the builder Docker image on every pull request.
# Job 1: builds and pushes the image to GHCR tagged pr-<number> (same steps as publish.yml).
# Job 2: runs a multi-platform distribution build using that PR image (no release).
# Note: skipped for fork PRs because GITHUB_TOKEN cannot push to the parent repo's registry.
name: PR Docker Build and Test
on:
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
# Skip for fork PRs: GITHUB_TOKEN cannot push to the parent repo's GHCR.
if: github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=sha,format=long
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./builder
file: ./builder/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
test-with-image:
needs: build-and-push
permissions:
contents: read
packages: read
strategy:
matrix:
platform: [linux/amd64, linux/arm64, darwin/arm64, windows/amd64]
include:
- platform: linux/amd64
os: linux
arch: amd64
artifact_name: linux-amd64
- platform: linux/arm64
os: linux
arch: arm64
artifact_name: linux-arm64
- platform: darwin/arm64
os: darwin
arch: arm64
artifact_name: darwin-arm64
- platform: windows/amd64
os: windows
arch: amd64
artifact_name: windows-amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Package
env:
IMAGE_REF: ${{ env.REGISTRY }}/${{ github.repository }}:pr-${{ github.event.pull_request.number }}
INPUT_MANIFEST: /github/workspace/manifest.yaml
INPUT_ARTIFACT_DIR: /github/workspace/artifacts
INPUT_OS: ${{ matrix.os }}
INPUT_ARCH: ${{ matrix.arch }}
run: |
IMAGE_REF_LOWER=$(echo "$IMAGE_REF" | tr '[:upper:]' '[:lower:]')
docker run --rm \
-v "${{ github.workspace }}:/github/workspace" \
-e INPUT_MANIFEST \
-e INPUT_ARTIFACT_DIR \
-e INPUT_OS \
-e INPUT_ARCH \
"$IMAGE_REF_LOWER"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: distribution-artifacts-${{ matrix.artifact_name }}
path: |
${{ github.workspace }}/artifacts/*.sbom.json
${{ github.workspace }}/artifacts/*_checksums.txt
${{ matrix.os == 'linux' && format('{0}/artifacts/*.deb', github.workspace) }}
${{ matrix.os == 'linux' && format('{0}/artifacts/*.rpm', github.workspace) }}
${{ matrix.os == 'linux' && format('{0}/artifacts/*.apk', github.workspace) }}
${{ (matrix.os == 'linux' || matrix.os == 'darwin') && format('{0}/artifacts/*.tar.gz', github.workspace) }}
${{ matrix.os == 'windows' && format('{0}/artifacts/*.zip', github.workspace) }}
retention-days: 5