-
Notifications
You must be signed in to change notification settings - Fork 1.6k
181 lines (166 loc) · 7.54 KB
/
prepare-release.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
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
name: Automation - Prepare Release
on:
workflow_dispatch:
# Determine the version number that will be assigned to the release. During the beta phase, we increment
# the minor version number and set the patch number to 0.
inputs:
candidate-stable:
description: Release candidate version bump (stable).
type: choice
options:
- minor
- patch
- "no bump"
default: minor
candidate-beta:
description: Release candidate version bump (beta).
type: choice
options:
- minor
- patch
default: minor
permissions: read-all
jobs:
extract-versions:
outputs:
current-beta: ${{ steps.current-version-core-beta.outputs.tags }}
current-stable: ${{ steps.current-version-core-stable-trimmed.outputs.tag }}
next-beta: ${{ steps.next-versions.outputs.next_beta }}
next-stable: ${{ steps.next-versions.outputs.next_stable }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get current tag for core beta
id: current-version-core-beta
uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1.4.0
with:
prefix: v0
- name: Get current tag for core stable
id: current-version-core-stable
uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1.4.0
with:
prefix: component/v1 # needs to be a tag of a stable component because major tags are not published
- name: Clean up core tag
id: current-version-core-stable-trimmed
run: |
monorepo_tag=${{ steps.current-version-core-stable.outputs.tag }}
echo "tag=${monorepo_tag#component/}" >> $GITHUB_OUTPUT
- name: Get next versions - beta
id: semvers-beta
uses: WyriHaximus/github-action-next-semvers@18aa9ed4152808ab99b88d71f5481e41f8d89930 # v1.2.1
with:
version: ${{ steps.current-version-core-beta.outputs.tag }}
- name: Get next versions - stable
id: semvers-stable
uses: WyriHaximus/github-action-next-semvers@18aa9ed4152808ab99b88d71f5481e41f8d89930 # v1.2.1
with:
version: ${{ steps.current-version-core-stable-trimmed.outputs.tag }}
- name: Select next versions
id: next-versions
run: |
# Candidate Beta
if [[ '${{ inputs.candidate-beta }}' == 'minor' ]]; then
echo "next_beta=${{ steps.semvers-beta.outputs.minor }}" >> $GITHUB_OUTPUT
elif [[ '${{ inputs.candidate-beta }}' == 'patch' ]]; then
echo "next_beta=${{ steps.semvers-beta.outputs.patch }}" >> $GITHUB_OUTPUT
elif [[ '${{ inputs.candidate-beta }}' == 'no bump' ]]; then
echo "next_beta=" >> $GITHUB_OUTPUT
else
echo "Error: unsupported semver type for Candidate Beta"
exit 1
fi
# Candidate Stable
if [[ '${{ inputs.candidate-stable }}' == 'minor' ]]; then
echo "next_stable=${{ steps.semvers-stable.outputs.minor }}" >> $GITHUB_OUTPUT
elif [[ '${{ inputs.candidate-stable }}' == 'patch' ]]; then
echo "next_stable=${{ steps.semvers-stable.outputs.patch }}" >> $GITHUB_OUTPUT
elif [[ '${{ inputs.candidate-stable }}' == 'no bump' ]]; then
echo "next_stable=" >> $GITHUB_OUTPUT
else
echo "Error: unsupported semver type Candidate Stable"
exit 1
fi
check-blockers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
# Make sure that there are no open issues with release:blocker label in Core. The release has to be delayed until they are resolved.
- name: Check blockers in core
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: open-telemetry/opentelemetry-collector
run: ./.github/workflows/scripts/release-check-blockers.sh
# Make sure that there are no open issues with release:blocker label in Contrib. The release has to be delayed until they are resolved.
- name: Check blockers in contrib
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: open-telemetry/opentelemetry-collector-contrib
run: ./.github/workflows/scripts/release-check-blockers.sh
# Make sure the current main branch build successfully passes (Core).
- name: Check build status in core
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: open-telemetry/opentelemetry-collector
run: ./.github/workflows/scripts/release-check-build-status.sh
# Make sure the current main branch build successfully passes (Contrib).
- name: Check build status in contrib
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: open-telemetry/opentelemetry-collector-contrib
run: ./.github/workflows/scripts/release-check-build-status.sh
create-release-issue:
needs:
- check-blockers
- extract-versions
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
# To keep track of the progress, it might be helpful to create a tracking issue similar to #6067. You are responsible
# for all of the steps under the "Performed by collector release manager" heading. Once the issue is created, you can
# create the individual ones by hovering them and clicking the "Convert to issue" button on the right hand side.
- name: Create issue for tracking release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CANDIDATE_BETA: ${{ needs.extract-versions.outputs.next-beta }}
CANDIDATE_STABLE: ${{ needs.extract-versions.outputs.next-stable }}
CURRENT_BETA: ${{ needs.extract-versions.outputs.current-beta }}
CURRENT_STABLE: ${{ needs.extract-versions.outputs.current-stable }}
REPO: open-telemetry/opentelemetry-collector
run: ./.github/workflows/scripts/release-create-tracking-issue.sh
# Releasing opentelemetry-collector
prepare-release:
needs:
- check-blockers
- extract-versions
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ~1.23.7
# Prepare Core for release.
# - Update CHANGELOG.md file, this is done via chloggen
# - Run make prepare-release PREVIOUS_VERSION=1.0.0 RELEASE_CANDIDATE=1.1.0 MODSET=stable
# - Run make prepare-release PREVIOUS_VERSION=0.52.0 RELEASE_CANDIDATE=0.53.0 MODSET=beta
- name: Prepare release for core
env:
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
REPO: open-telemetry/opentelemetry-collector
CANDIDATE_BETA: ${{ needs.extract-versions.outputs.next-beta }}
CANDIDATE_STABLE: ${{ needs.extract-versions.outputs.next-stable }}
CURRENT_BETA: ${{ needs.extract-versions.outputs.current-beta }}
CURRENT_STABLE: ${{ needs.extract-versions.outputs.current-stable }}
run: ./.github/workflows/scripts/release-prepare-release.sh