-
Notifications
You must be signed in to change notification settings - Fork 3.5k
127 lines (122 loc) · 4.99 KB
/
golden.yml
File metadata and controls
127 lines (122 loc) · 4.99 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: golden
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
paths-ignore:
- "**/README.md"
merge_group:
pull_request:
paths-ignore:
- "**/README.md"
env:
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: read-all
jobs:
build-dev:
runs-on: ubuntu-24.04
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Build binaries
run: |
GOOS=linux GOARCH=ppc64le make golden
GOOS=linux GOARCH=arm64 make golden
GOOS=linux GOARCH=amd64 make golden
GOOS=linux GOARCH=s390x make golden
cp bin/golden_* cmd/golden/
- name: Build golden
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
context: cmd/golden
push: false
tags: ghcr.io/open-telemetry/opentelemetry-collector-contrib/golden:dev
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
- run: ./.github/workflows/scripts/check-disk-space.sh
publish-latest:
runs-on: ubuntu-24.04
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && github.repository == 'open-telemetry/opentelemetry-collector-contrib'
permissions:
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build binaries
run: |
GOOS=linux GOARCH=ppc64le make golden
GOOS=linux GOARCH=arm64 make golden
GOOS=linux GOARCH=amd64 make golden
GOOS=linux GOARCH=s390x make golden
cp bin/golden_* cmd/golden/
- name: Push golden to Github packages
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
context: cmd/golden
push: true
tags: ghcr.io/open-telemetry/opentelemetry-collector-contrib/golden:latest
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
- run: ./.github/workflows/scripts/check-disk-space.sh
publish-stable:
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'open-telemetry/opentelemetry-collector-contrib'
permissions:
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Set Release Tag
id: github_tag
run: ./.github/workflows/scripts/set_release_tag.sh
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build binaries
run: |
GOOS=linux GOARCH=ppc64le make golden
GOOS=linux GOARCH=arm64 make golden
GOOS=linux GOARCH=amd64 make golden
GOOS=linux GOARCH=s390x make golden
cp bin/golden_* cmd/golden/
- name: Push golden to Github packages
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
context: cmd/golden
push: true
tags: ghcr.io/open-telemetry/opentelemetry-collector-contrib/golden:${{ steps.github_tag.outputs.tag }}
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
- run: ./.github/workflows/scripts/check-disk-space.sh