Run in a privileged container via podman #17
This file contains 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: Prep OTEL source | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
actions: write | |
contents: write | |
id-token: write | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '>=1.21.6' | |
- name: Check golang version | |
run: go version | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Clone opentelemetry-collector repository | |
uses: actions/checkout@v4 | |
with: | |
repository: open-telemetry/opentelemetry-collector | |
path: opentelemetry-collector | |
ref: 'v0.93.0' | |
- name: Build ocb | |
run: | | |
cd opentelemetry-collector | |
make ocb | |
- name: Build custom otel source code | |
run: | | |
cd opentelemetry-collector | |
./bin/ocb_linux_amd64 --skip-compilation --config ../manifest.yaml | |
- name: Vendor the depedency source code | |
run: | | |
cd opentelemetry-collector/_build | |
go mod vendor | |
- name: Copy the new source code | |
run: | | |
mkdir -p src | |
rsync -av opentelemetry-collector/_build/ . | |
- name: Commit and push if it changed | |
run: |- | |
git config user.name "Major Hayden" | |
git config user.email "[email protected]" | |
git add *.go go.mod go.sum | |
timestamp=$(date -u) | |
git commit -m "Updating source: ${timestamp}" || exit 0 | |
git clean -fxd | |
git status | |
git pull --rebase | |
git push | |
build: | |
needs: prepare | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Build RPM | |
run: | | |
podman run --rm -it --privileged \ | |
--volume src:/src quay.io/fedora/fedora:39 \ | |
/src/build_rpm.sh |