Skip to content

Commit d30fceb

Browse files
authored
Merge branch 'main' into update-version-otelbot
2 parents 143b965 + 321ebb5 commit d30fceb

29 files changed

+307
-47
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: releases
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Introduce nightly releases
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [1016]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [user]
26+

.github/workflows/base-ci-goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030

3131
env:
3232
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
33-
GORELEASER_PRO_VERSION: v2.11.0
33+
GORELEASER_PRO_VERSION: v2.11.1
3434

3535
jobs:
3636
check-goreleaser:

.github/workflows/base-release.yaml

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ on:
1616
required: false
1717
type: string
1818
default: ubuntu-24.04
19+
nightly:
20+
required: false
21+
type: string
22+
default: false
1923

2024
env:
2125
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
22-
GORELEASER_PRO_VERSION: v2.11.0
26+
GORELEASER_PRO_VERSION: v2.11.1
2327

2428
jobs:
2529
prepare:
30+
outputs:
31+
PREVIOUS_RELEASE_TAG: ${{ steps.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
2632
strategy:
2733
matrix:
2834
GOOS: ${{ fromJSON(inputs.goos) }}
@@ -72,8 +78,25 @@ jobs:
7278
go-version: "~1.24"
7379
check-latest: true
7480

81+
- name: Set goreleaser last tag reference in case of non-nightly release
82+
id: prev-tag
83+
if: inputs.nightly != 'true'
84+
# find previous tag by filtering out nightly tags and binary release (OCB, OpAMP) tags and then choosing the
85+
# second to last tag (last one is the current release)
86+
run: |
87+
prev_tag=$(git tag | grep -v "cmd" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
88+
echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"
89+
90+
- name: Set nightly enabled
91+
id: nightly-check
92+
if: inputs.nightly == 'true'
93+
run: |
94+
echo "NIGHTLY_FLAG=--nightly" >> "$GITHUB_OUTPUT"
95+
7596
- name: Generate distribution sources
7697
run: make generate-sources
98+
env:
99+
DISTRIBUTIONS: ${{ inputs.distribution }}
77100

78101
- name: Log into Docker.io
79102
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
@@ -101,7 +124,7 @@ jobs:
101124
distribution: goreleaser-pro
102125
version: ${{ env.GORELEASER_PRO_VERSION }}
103126
workdir: distributions/${{ inputs.distribution }}
104-
args: release --clean --split --timeout 2h --config .goreleaser-build.yaml --release-header-tmpl=../../.github/release-template.md
127+
args: release --clean --split --timeout 2h --config .goreleaser-build.yaml --release-header-tmpl=../../.github/release-template.md ${{ steps.nightly-check.outputs.NIGHTLY_FLAG }}
105128
env:
106129
GOOS: ${{ matrix.GOOS }}
107130
GOARCH: ${{ matrix.GOARCH }}
@@ -111,6 +134,7 @@ jobs:
111134
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
112135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113136
COSIGN_YES: true
137+
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
114138

115139
- name: Move built artifacts
116140
if: inputs.distribution == 'otelcol-contrib'
@@ -127,7 +151,7 @@ jobs:
127151
distribution: goreleaser-pro
128152
version: ${{ env.GORELEASER_PRO_VERSION }}
129153
workdir: distributions/${{ inputs.distribution }}
130-
args: release --clean --split --timeout 2h --release-header-tmpl=../../.github/release-template.md
154+
args: release --clean --split --timeout 2h --release-header-tmpl=../../.github/release-template.md ${{ steps.nightly-check.outputs.NIGHTLY_FLAG }}
131155
env:
132156
GOOS: ${{ matrix.GOOS }}
133157
GOARCH: ${{ matrix.GOARCH }}
@@ -143,7 +167,7 @@ jobs:
143167
if-no-files-found: error
144168

145169
release:
146-
name: ${{ inputs.distribution }} Release
170+
name: Release
147171
runs-on: ${{ inputs.runner_os }}
148172
needs: prepare
149173

@@ -232,3 +256,38 @@ jobs:
232256
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
233257
COSIGN_YES: true
234258
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
259+
GORELEASER_PREVIOUS_TAG: ${{ needs.prepare.outputs.PREVIOUS_RELEASE_TAG }}
260+
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
261+
262+
create-issue:
263+
name: Create GitHub issue on failed nightly release
264+
runs-on: ubuntu-latest
265+
needs: [release]
266+
if: failure() && inputs.nightly == 'true'
267+
permissions:
268+
issues: write
269+
env:
270+
issue-file: "nightly-release-failure.md"
271+
steps:
272+
- name: Formulate issue
273+
run: |
274+
# create a markdown file that contains details about the failure
275+
echo "---" > ${{ env.issue-file }}
276+
echo "title: Nightly Release Failed" >> ${{ env.issue-file }}
277+
echo "labels: release:blocker" >> ${{ env.issue-file }}
278+
echo "---" >> ${{ env.issue-file }}
279+
echo "The nightly release failed in the following GitHub actions run." >> ${{ env.issue-file }}
280+
echo "* Link to run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> ${{ env.issue-file }}
281+
echo "* Please also check the other distro release runs related to this nightly release" >> ${{ env.issue-file }}
282+
echo "* Triggered by: Nightly scheduled release" >> ${{ env.issue-file }}
283+
echo "" >> ${{ env.issue-file }}
284+
echo "Note: This issue was auto-generated from [base-release.yaml](https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.github/workflows/base-release.yaml)" >> ${{ env.issue-file }}
285+
286+
- name: Create or update issue
287+
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
288+
env:
289+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
290+
with:
291+
update_existing: true
292+
search_existing: open
293+
filename: ${{ env.issue-file }}

.github/workflows/ci-builder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
env:
2727
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
28-
GORELEASER_PRO_VERSION: v2.11.0
28+
GORELEASER_PRO_VERSION: v2.11.1
2929

3030
jobs:
3131
check-goreleaser:

.github/workflows/ci-goreleaser-core.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CI - Core - GoReleaser
22

33
on:
4-
merge_group:
4+
merge_group:
55
push:
66
branches: [main]
77
paths:
@@ -34,12 +34,12 @@ jobs:
3434
secrets: inherit
3535

3636
package-tests:
37-
name: Package tests
38-
needs: check-goreleaser
39-
uses: ./.github/workflows/base-package-tests.yaml
40-
with:
41-
distribution: otelcol
42-
type: '[ "deb", "rpm" ]'
37+
name: Package tests
38+
needs: check-goreleaser
39+
uses: ./.github/workflows/base-package-tests.yaml
40+
with:
41+
distribution: otelcol
42+
type: '[ "deb", "rpm" ]'
4343

4444
msi-tests:
4545
name: MSI tests

.github/workflows/ci-opampsupervisor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
env:
2525
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
26-
GORELEASER_PRO_VERSION: v2.11.0
26+
GORELEASER_PRO_VERSION: v2.11.1
2727

2828
jobs:
2929
check-goreleaser:
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Nightly Release
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 2 * * *" # release nightly at 2AM
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
nightly-release:
13+
name: Nightly Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
18+
id: otelbot-token
19+
with:
20+
app-id: ${{ vars.OTELBOT_COLLECTOR_RELEASES_APP_ID }}
21+
private-key: ${{ secrets.OTELBOT_COLLECTOR_RELEASES_PRIVATE_KEY }}
22+
permission-contents: write
23+
24+
# The next 2 steps are taken from # from https://github.com/actions/create-github-app-token#create-a-git-committer-string-for-an-app-installation
25+
- name: Get GitHub App User ID
26+
id: get-user-id
27+
run: echo "user-id=$(gh api "/users/${{ steps.otelbot-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
28+
env:
29+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
30+
31+
- name: Set up commit author name and email
32+
id: committer
33+
run: |
34+
echo "name=${{ steps.otelbot-token.outputs.app-slug }}[bot]" >> "$GITHUB_OUTPUT"
35+
echo "email=${{ steps.get-user-id.outputs.user-id }}+${{ steps.otelbot-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
36+
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
fetch-depth: 0
40+
token: ${{ steps.otelbot-token.outputs.token }}
41+
42+
- name: 'Push new tag'
43+
run: |
44+
git config user.name "${{ steps.committer.outputs.name }}"
45+
git config user.email "${{ steps.committer.outputs.email }}"
46+
47+
# A previous release was created using a lightweight tag
48+
# git describe by default includes only annotated tags
49+
# git describe --tags includes lightweight tags as well
50+
DESCRIBE=`git tag -l --sort=-v:refname | grep -v cmd | grep -v nightly | head -n 1` # list tags except the ones containing cmd or nightly and then take the latest one
51+
MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` # take just the major version digits, e.g. "v0"
52+
MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` # take just the minor version digits, e.g. "130"
53+
MINOR_VERSION="$((${MINOR_VERSION} + 1))" # bump minor version
54+
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d%H%M')"
55+
git tag -a $TAG -m "$TAG: nightly build"
56+
git push origin $TAG

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
45+
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
4646
with:
4747
sarif_file: results.sarif

.github/workflows/release-builder.yaml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
env:
88
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
9-
GORELEASER_PRO_VERSION: v2.11.0
9+
GORELEASER_PRO_VERSION: v2.11.1
1010

1111
jobs:
1212
goreleaser:
@@ -22,23 +22,51 @@ jobs:
2222
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2323
with:
2424
fetch-depth: 0
25+
26+
- name: Set goreleaser last tag reference in case of non-nightly release
27+
id: prev-tag
28+
if: ${{ !contains(github.ref, '-nightly') }}
29+
# find previous tag by taking only OCB tags, filtering out nightly tags and then choosing the
30+
# second to last tag (last one is the current release)
31+
run: |
32+
prev_tag=$(git tag | grep "cmd/builder" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
33+
echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"
34+
35+
- name: Set nightly enabled
36+
id: nightly-check
37+
if: ${{ contains(github.ref, '-nightly') }}
38+
run: |
39+
echo "NIGHTLY_FLAG=--nightly" >> "$GITHUB_OUTPUT"
40+
41+
- name: Set COLLECTOR_REF
42+
id: collector-ref
43+
run: |
44+
if [ '${{ contains(github.ref, '-nightly') }}' == 'true' ]; then
45+
echo "COLLECTOR_REF=main" >> "$GITHUB_OUTPUT"
46+
else
47+
echo "COLLECTOR_TAG=${{ github.ref }}" >> "$GITHUB_OUTPUT"
48+
fi
49+
2550
- name: Push cmd/builder Tag
2651
run: |
2752
tag="cmd/builder/${{ github.ref_name }}"
28-
message="Releasing ocb binaries for ${{ github.ref_name }}"
53+
message="Releasing ocb binaries for ${{ steps.collector-ref.outputs.COLLECTOR_REF }}"
2954
git config user.name "${GITHUB_ACTOR}"
3055
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
3156
git tag -a "${tag}" -m "${message}"
3257
git push origin "${tag}"
58+
3359
- name: Checkout Core Repo
3460
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3561
with:
3662
fetch-depth: 0
3763
repository: "open-telemetry/opentelemetry-collector"
38-
ref: ${{ github.ref_name }}
64+
ref: ${{ steps.collector-ref.outputs.COLLECTOR_REF }}
3965
path: ".core"
66+
4067
- name: Copy Dockerfile to Core Repo directory
4168
run: cp cmd/builder/Dockerfile .core/cmd/builder/Dockerfile
69+
4270
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
4371
- uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
4472
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
@@ -49,6 +77,7 @@ jobs:
4977
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5078
with:
5179
go-version: "~1.24"
80+
5281
- name: Log into Docker.io
5382
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
5483
with:
@@ -60,14 +89,17 @@ jobs:
6089
registry: ghcr.io
6190
username: ${{ github.repository_owner }}
6291
password: ${{ secrets.GITHUB_TOKEN }}
92+
6393
- name: Run GoReleaser
6494
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
6595
with:
6696
distribution: goreleaser-pro
6797
version: ${{ env.GORELEASER_PRO_VERSION }}
68-
args: release --clean -f cmd/builder/.goreleaser.yml
98+
args: release --clean -f cmd/builder/.goreleaser.yml ${{ steps.nightly-check.outputs.NIGHTLY_FLAG }}
6999
env:
70100
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
71101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72102
COSIGN_YES: true
73103
SKIP_SIGNS: false
104+
GORELEASER_PREVIOUS_TAG: ${{ steps.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
105+
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}

.github/workflows/release-contrib.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ jobs:
1212
distribution: otelcol-contrib
1313
goos: '[ "linux", "darwin" ]'
1414
goarch: '[ "386", "amd64", "arm64", "ppc64le", "arm", "s390x" ]'
15+
nightly: ${{ contains(github.ref, '-nightly') }}
1516
secrets: inherit
1617
permissions: write-all
1718
release-windows:
1819
name: Release Contrib (Windows)
20+
if: ${{ !contains(github.ref, '-nightly') }}
1921
uses: ./.github/workflows/base-release.yaml
2022
with:
2123
distribution: otelcol-contrib

0 commit comments

Comments
 (0)