Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3ef3d04
add nightly release setup with pipeline and goreleaser settings
mowies Jul 3, 2025
b772ef3
revert otelcol dockers
mowies Jul 16, 2025
97465d3
fix pipeline
mowies Jul 16, 2025
770e212
cherry pick fixes?
mowies Jul 17, 2025
97c5a1d
more setup things
mowies Jul 17, 2025
e7e421b
revert some debugging changes
mowies Jul 22, 2025
46c364b
revert goreleaser debugging changes
mowies Jul 22, 2025
680618b
revert debugging changes for builder and opamp
mowies Jul 22, 2025
ee14504
revert debugging changes in dockerfiles
mowies Jul 22, 2025
0f319c4
remove force pushes
mowies Jul 23, 2025
b91d098
Merge branch 'main' into two-step-release-process
mowies Jul 23, 2025
b29252a
Merge branch 'main' into two-step-release-process
mowies Jul 23, 2025
1c28859
Merge branch 'main' into two-step-release-process
mowies Jul 24, 2025
abe369f
rename GORELEASER_PREVIOUS_TAG
mowies Jul 24, 2025
52bb40d
filter tags before taking the right one for all release pipelines
mowies Jul 22, 2025
637a143
adjust doc comments
mowies Jul 24, 2025
c4ef958
add missing newlines
mowies Jul 24, 2025
d4bcc8c
Merge branch 'main' into two-step-release-process
mowies Jul 24, 2025
9d01019
update goreleaser to correct version
mowies Jul 28, 2025
f929a2d
revert change of github token in base-release
mowies Jul 28, 2025
8a65a1b
add comments
mowies Jul 28, 2025
56cf929
Merge branch 'main' into two-step-release-process
mowies Jul 28, 2025
87bab64
Merge branch 'main' into two-step-release-process
mowies Jul 29, 2025
a7c1cb1
use otelbot short time token for pushing nightly tags
mowies Jul 29, 2025
317a755
set specific content write permission for new token
mowies Jul 29, 2025
33b71f6
disable publishing nightly releases
mowies Jul 29, 2025
3fe58dd
revert changes of github tokens
mowies Jul 29, 2025
da81c5b
revert changes of github tokens
mowies Jul 29, 2025
a0d3869
set up otelbot app committer name and email correctly
mowies Jul 29, 2025
4c6f299
create issue on failed nightly release
mowies Jul 29, 2025
0beaca3
add note about other distro releases
mowies Jul 29, 2025
2d99c77
Merge branch 'main' into two-step-release-process
mowies Jul 30, 2025
17d6470
Merge branch 'main' into two-step-release-process
mowies Jul 30, 2025
48d0ede
add changelog entry
mowies Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .chloggen/mowies-nightly-releases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: releases

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Introduce nightly releases

# One or more tracking issues or pull requests related to the change
issues: [1016]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]

65 changes: 62 additions & 3 deletions .github/workflows/base-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ on:
required: false
type: string
default: ubuntu-24.04
nightly:
required: false
type: string
default: false

env:
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
GORELEASER_PRO_VERSION: v2.11.0

jobs:
prepare:
outputs:
PREVIOUS_RELEASE_TAG: ${{ steps.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
strategy:
matrix:
GOOS: ${{ fromJSON(inputs.goos) }}
Expand Down Expand Up @@ -72,8 +78,25 @@ jobs:
go-version: "~1.24"
check-latest: true

- name: Set goreleaser last tag reference in case of non-nightly release
id: prev-tag
if: inputs.nightly != 'true'
# find previous tag by filtering out nightly tags and binary release (OCB, OpAMP) tags and then choosing the
# second to last tag (last one is the current release)
run: |
prev_tag=$(git tag | grep -v "cmd" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"

- name: Set nightly enabled
id: nightly-check
if: inputs.nightly == 'true'
run: |
echo "NIGHTLY_FLAG=--nightly" >> "$GITHUB_OUTPUT"

- name: Generate distribution sources
run: make generate-sources
env:
DISTRIBUTIONS: ${{ inputs.distribution }}

- name: Log into Docker.io
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
Expand Down Expand Up @@ -101,7 +124,7 @@ jobs:
distribution: goreleaser-pro
version: ${{ env.GORELEASER_PRO_VERSION }}
workdir: distributions/${{ inputs.distribution }}
args: release --clean --split --timeout 2h --config .goreleaser-build.yaml --release-header-tmpl=../../.github/release-template.md
args: release --clean --split --timeout 2h --config .goreleaser-build.yaml --release-header-tmpl=../../.github/release-template.md ${{ steps.nightly-check.outputs.NIGHTLY_FLAG }}
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
Expand All @@ -111,6 +134,7 @@ jobs:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_YES: true
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}

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

release:
name: ${{ inputs.distribution }} Release
name: Release
runs-on: ${{ inputs.runner_os }}
needs: prepare

Expand Down Expand Up @@ -232,3 +256,38 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_YES: true
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GORELEASER_PREVIOUS_TAG: ${{ needs.prepare.outputs.PREVIOUS_RELEASE_TAG }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}

create-issue:
name: Create GitHub issue on failed nightly release
runs-on: ubuntu-latest
needs: [release]
if: failure() && inputs.nightly == 'true'
permissions:
issues: write
env:
issue-file: "nightly-release-failure.md"
steps:
- name: Formulate issue
run: |
# create a markdown file that contains details about the failure
echo "---" > ${{ env.issue-file }}
echo "title: Nightly Release Failed" >> ${{ env.issue-file }}
echo "labels: release:blocker" >> ${{ env.issue-file }}
echo "---" >> ${{ env.issue-file }}
echo "The nightly release failed in the following GitHub actions run." >> ${{ env.issue-file }}
echo "* Link to run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> ${{ env.issue-file }}
echo "* Please also check the other distro release runs related to this nightly release" >> ${{ env.issue-file }}
echo "* Triggered by: Nightly scheduled release" >> ${{ env.issue-file }}
echo "" >> ${{ env.issue-file }}
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 }}

- name: Create or update issue
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
update_existing: true
search_existing: open
filename: ${{ env.issue-file }}
14 changes: 7 additions & 7 deletions .github/workflows/ci-goreleaser-core.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI - Core - GoReleaser

on:
merge_group:
merge_group:
push:
branches: [main]
paths:
Expand Down Expand Up @@ -34,12 +34,12 @@ jobs:
secrets: inherit

package-tests:
name: Package tests
needs: check-goreleaser
uses: ./.github/workflows/base-package-tests.yaml
with:
distribution: otelcol
type: '[ "deb", "rpm" ]'
name: Package tests
needs: check-goreleaser
uses: ./.github/workflows/base-package-tests.yaml
with:
distribution: otelcol
type: '[ "deb", "rpm" ]'

msi-tests:
name: MSI tests
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Nightly Release

on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *" # release nightly at 2AM

permissions:
contents: read

env:
# renovate: datasource=github-tags depName=goreleaser-pro packageName=goreleaser/goreleaser-pro
GORELEASER_PRO_VERSION: v2.11.0

jobs:
nightly-release:
name: Nightly Release
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_COLLECTOR_RELEASES_APP_ID }}
private-key: ${{ secrets.OTELBOT_COLLECTOR_RELEASES_PRIVATE_KEY }}
permission-contents: write

# 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
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.otelbot-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}

- name: Set up commit author name and email
id: committer
run: |
echo "name=${{ steps.otelbot-token.outputs.app-slug }}[bot]" >> "$GITHUB_OUTPUT"
echo "email=${{ steps.get-user-id.outputs.user-id }}+${{ steps.otelbot-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
token: ${{ steps.otelbot-token.outputs.token }}

- name: 'Push new tag'
run: |
git config user.name "${{ steps.committer.outputs.name }}"
git config user.email "${{ steps.committer.outputs.email }}"

# A previous release was created using a lightweight tag
# git describe by default includes only annotated tags
# git describe --tags includes lightweight tags as well
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
MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` # take just the major version digits, e.g. "v0"
MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` # take just the minor version digits, e.g. "130"
MINOR_VERSION="$((${MINOR_VERSION} + 1))" # bump minor version
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d%H%M')"
git tag -a $TAG -m "$TAG: nightly build"
git push origin $TAG
38 changes: 35 additions & 3 deletions .github/workflows/release-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,51 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Set goreleaser last tag reference in case of non-nightly release
id: prev-tag
if: ${{ !contains(github.ref, '-nightly') }}
# find previous tag by taking only OCB tags, filtering out nightly tags and then choosing the
# second to last tag (last one is the current release)
run: |
prev_tag=$(git tag | grep "cmd/builder" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"

- name: Set nightly enabled
id: nightly-check
if: ${{ contains(github.ref, '-nightly') }}
run: |
echo "NIGHTLY_FLAG=--nightly" >> "$GITHUB_OUTPUT"

- name: Set COLLECTOR_REF
id: collector-ref
run: |
if [ '${{ contains(github.ref, '-nightly') }}' == 'true' ]; then
echo "COLLECTOR_REF=main" >> "$GITHUB_OUTPUT"
else
echo "COLLECTOR_TAG=${{ github.ref }}" >> "$GITHUB_OUTPUT"
fi

- name: Push cmd/builder Tag
run: |
tag="cmd/builder/${{ github.ref_name }}"
message="Releasing ocb binaries for ${{ github.ref_name }}"
message="Releasing ocb binaries for ${{ steps.collector-ref.outputs.COLLECTOR_REF }}"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "${message}"
git push origin "${tag}"

- name: Checkout Core Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
repository: "open-telemetry/opentelemetry-collector"
ref: ${{ github.ref_name }}
ref: ${{ steps.collector-ref.outputs.COLLECTOR_REF }}
path: ".core"

- name: Copy Dockerfile to Core Repo directory
run: cp cmd/builder/Dockerfile .core/cmd/builder/Dockerfile

- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
Expand All @@ -49,6 +77,7 @@ jobs:
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "~1.24"

- name: Log into Docker.io
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
Expand All @@ -60,14 +89,17 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
with:
distribution: goreleaser-pro
version: ${{ env.GORELEASER_PRO_VERSION }}
args: release --clean -f cmd/builder/.goreleaser.yml
args: release --clean -f cmd/builder/.goreleaser.yml ${{ steps.nightly-check.outputs.NIGHTLY_FLAG }}
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_YES: true
SKIP_SIGNS: false
GORELEASER_PREVIOUS_TAG: ${{ steps.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
2 changes: 2 additions & 0 deletions .github/workflows/release-contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
distribution: otelcol-contrib
goos: '[ "linux", "darwin" ]'
goarch: '[ "386", "amd64", "arm64", "ppc64le", "arm", "s390x" ]'
nightly: ${{ contains(github.ref, '-nightly') }}
secrets: inherit
permissions: write-all
release-windows:
name: Release Contrib (Windows)
if: ${{ !contains(github.ref, '-nightly') }}
uses: ./.github/workflows/base-release.yaml
with:
distribution: otelcol-contrib
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
distribution: otelcol
goos: '[ "linux", "darwin" ]'
goarch: '[ "386", "amd64", "arm64", "ppc64le", "arm", "s390x" ]'
nightly: ${{ contains(github.ref, '-nightly') }}
secrets: inherit
permissions: write-all
release-windows:
name: Release Core (Windows)
if: ${{ !contains(github.ref, '-nightly') }}
uses: ./.github/workflows/base-release.yaml
with:
distribution: otelcol
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
distribution: otelcol-k8s
goos: '[ "linux" ]'
goarch: '[ "amd64", "arm64", "ppc64le", "s390x" ]'
nightly: ${{ contains(github.ref, '-nightly') }}
secrets: inherit
permissions: write-all
release-windows:
name: Release k8s (Windows)
if: ${{ !contains(github.ref, '-nightly') }}
uses: ./.github/workflows/base-release.yaml
with:
distribution: otelcol-k8s
Expand Down
Loading