-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (76 loc) · 2.15 KB
/
prepare_source.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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 --privileged \
--volume ${GITHUB_WORKSPACE}/src:/src quay.io/fedora/fedora:39 \
"bash /src/build_rpm.sh"