-
Notifications
You must be signed in to change notification settings - Fork 13
221 lines (216 loc) · 8.67 KB
/
discover-new-releases.yaml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Discover new OtelCol releases
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch: {}
jobs:
check-community-releases:
name: OpenTelemetry official distribution
strategy:
fail-fast: false
matrix:
distro:
- name: otelcol-core
artifact_prefix: otelcol_
artifact_suffix: _linux_amd64.rpm
- name: otelcol-contrib
artifact_prefix: otelcol-contrib_
artifact_suffix: _linux_amd64.rpm
runs-on: ubuntu-latest
outputs:
releases: ${{ steps.list-releases.outputs.releases }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
env:
NODE_MAJOR: 20
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
- name: Build list generator
working-directory: .github/workflows/scripts/list-releases
run: |
npm install
npm run build
- name: Look up ignored releases range
id: lookup-ignored-releases
shell: bash
working-directory: packages/otelbin-validation/src/assets
run: |
echo "range=$(jq -r '.["${{matrix.distro.name}}"].ignoredReleases' < supported-distributions.json)" | tee -a ${GITHUB_OUTPUT}
- name: List matching releases
id: list-releases
shell: bash
env:
DISTRO_NAME: ${{ matrix.distro.name }}
GH_REPOSITORY: open-telemetry/opentelemetry-collector-releases
GH_ASSET_PREFIX: ${{ matrix.distro.artifact_prefix }}
GH_ASSET_SUFFIX: ${{ matrix.distro.artifact_suffix }}
IGNORED_RELEASES: ${{ steps.lookup-ignored-releases.outputs.range }}
working-directory: .github/workflows/scripts/list-releases
run: |
npm run start --silent | tee releases.json
- name: Upload releases.json artifact
uses: actions/upload-artifact@v4
with:
name: releases-${{ matrix.distro.name }}
path: .github/workflows/scripts/list-releases/releases.json
check-splunk-releases:
name: Splunk OpenTelemetry Collector
strategy:
fail-fast: false
matrix:
distro:
- name: splunk-otel-collector
artifact_prefix: splunk-otel-collector
artifact_suffix: x86_64.rpm
runs-on: ubuntu-latest
outputs:
releases: ${{ steps.list-releases.outputs.releases }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
env:
NODE_MAJOR: 20
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
- name: Build list generator
working-directory: .github/workflows/scripts/list-releases
run: |
npm install
npm run build
- name: Look up ignored releases range
id: lookup-ignored-releases
shell: bash
working-directory: packages/otelbin-validation/src/assets
run: |
echo "range=$(jq -r '.["${{matrix.distro.name}}"].ignoredReleases' < supported-distributions.json)" | tee -a ${GITHUB_OUTPUT}
- name: List matching releases
id: list-releases
shell: bash
env:
DISTRO_NAME: ${{ matrix.distro.name }}
GH_REPOSITORY: signalfx/splunk-otel-collector
GH_ASSET_PREFIX: ${{ matrix.distro.artifact_prefix }}
GH_ASSET_SUFFIX: ${{ matrix.distro.artifact_suffix }}
IGNORED_RELEASES: ${{ steps.lookup-ignored-releases.outputs.range }}
working-directory: .github/workflows/scripts/list-releases
run: |
npm run start --silent | tee releases.json
- name: Upload releases.json artifact
uses: actions/upload-artifact@v4
with:
name: releases-${{ matrix.distro.name }}
path: .github/workflows/scripts/list-releases/releases.json
check-adot-releases:
name: AWS Distro for OpenTelemetry
strategy:
fail-fast: false
runs-on: ubuntu-latest
outputs:
releases: ${{ steps.list-releases.outputs.releases }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
env:
NODE_MAJOR: 20
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
- name: Build list generator
working-directory: .github/workflows/scripts/list-releases
run: |
npm install
npm run build
- name: Look up ignored releases range
id: lookup-ignored-releases
shell: bash
working-directory: packages/otelbin-validation/src/assets
run: |
echo "range=$(jq -r '.["adot"].ignoredReleases' < supported-distributions.json)" | tee -a ${GITHUB_OUTPUT}
- name: List matching releases
id: list-releases
working-directory: .github/workflows/scripts/list-releases
env:
DISTRO_NAME: adot
GH_REPOSITORY: aws-observability/aws-otel-collector
IGNORED_RELEASES: ${{ steps.lookup-ignored-releases.outputs.range }}
run: |
npm run start --silent | tee releases.json
- name: Upload releases.json artifact
uses: actions/upload-artifact@v4
with:
name: releases-adot
path: .github/workflows/scripts/list-releases/releases.json
compose-supported-distro-list:
name: Compose supported distro list
needs:
- check-community-releases
- check-adot-releases
- check-splunk-releases
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
path: releases/
- name: Merge release data
run: |
mv packages/otelbin-validation/src/assets/supported-distributions.json packages/otelbin-validation/src/assets/supported-distributions.json.old
jq -rs 'reduce .[] as $item ({}; . * $item)' packages/otelbin-validation/src/assets/supported-distributions.json.old releases/*/*.json > packages/otelbin-validation/src/assets/supported-distributions.json
- name: Upload updated releases.json artifact
uses: actions/upload-artifact@v4
with:
name: supported-distributions
path: packages/otelbin-validation/src/assets/supported-distributions.json
create-pr:
name: Create Pull Request
needs:
- compose-supported-distro-list
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download updated supported distro list
uses: actions/download-artifact@v4
with:
name: supported-distributions
path: packages/otelbin-validation/src/assets
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: Update supported versions
commit-message: 'chore: update the version list of supported OpenTelemetry collector distros'
add-paths: packages/otelbin-validation/src/assets/supported-distributions.json
branch: update-supported-versions
reviewers: mmanciop,bripkens
author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'