Skip to content

Release v0.2.0. (#23) #15

Release v0.2.0. (#23)

Release v0.2.0. (#23) #15

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go tool builder --config collector/manifest.yaml --skip-compilation
- run: cd dist && go build -trimpath -o otelcol-oxide .
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
- run: |
mv dist/otelcol-oxide dist/otelcol-oxide-${{ matrix.goos }}-${{ matrix.goarch }}
- uses: actions/upload-artifact@v4
with:
name: otelcol-oxide-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/otelcol-oxide-${{ matrix.goos }}-${{ matrix.goarch }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- working-directory: dist
run: sha256sum otelcol-oxide-* > checksums.txt
- uses: softprops/action-gh-release@v2
with:
files: |
dist/otelcol-oxide-*
dist/checksums.txt
generate_release_notes: true
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: otelcol-oxide-linux-*
merge-multiple: true
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
# Note: Use Dockerfile.release and copy in images from the `build` step.
# This is much faster than using `docker buildx` with the standard
# Dockerfile, which relies on qemu for multi-arch builds and takes too long
# to complete on GitHub Actions.
- uses: docker/build-push-action@v6
with:
context: .
file: collector/Dockerfile.release
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}