From 32548b96d2c10c0e7500f0c8aa8ef90443103014 Mon Sep 17 00:00:00 2001 From: jackgopack4 Date: Wed, 31 Jul 2024 14:26:02 -0400 Subject: [PATCH] squash and merge changes from upstream Squashed commit of the following: commit 3efb49cd4657408beeb2ce91c6adbea82e335701 Author: jackgopack4 Date: Tue Jul 30 13:55:51 2024 -0400 migrate check-goreleaser workflow into releases repo commit 3a43e9a3732278d42a55dd87e304e2c2c13e114f Merge: ee1117c07 b81b76b4a Author: jackgopack4 Date: Tue Jul 30 13:28:55 2024 -0400 Merge remote-tracking branch 'open-telemetry/opentelemetry-collector/main' commit ee1117c07a779198bbf6ed11913d3bcbe42bc4c9 Author: jackgopack4 Date: Tue Jul 30 11:33:32 2024 -0400 remove auto-merged files commit ed2ff9eb4c2749c3b71a5071cadec563922ae6b0 Author: jackgopack4 Date: Tue Jul 30 11:06:38 2024 -0400 rebase and squash jackgopack4 commits --- .chloggen/ocb-migration.yaml | 25 ++++++++++++ .github/workflows/check-goreleaser.yaml | 32 --------------- ...r-release.yaml => sourcecode-release.yaml} | 17 +------- cmd/builder/.goreleaser.yml | 39 ------------------- docs/release.md | 13 +++---- 5 files changed, 33 insertions(+), 93 deletions(-) create mode 100644 .chloggen/ocb-migration.yaml delete mode 100644 .github/workflows/check-goreleaser.yaml rename .github/workflows/{builder-release.yaml => sourcecode-release.yaml} (72%) delete mode 100644 cmd/builder/.goreleaser.yml diff --git a/.chloggen/ocb-migration.yaml b/.chloggen/ocb-migration.yaml new file mode 100644 index 00000000000..1c59d893b3a --- /dev/null +++ b/.chloggen/ocb-migration.yaml @@ -0,0 +1,25 @@ +# 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: ocb + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: migrate build and release of ocb binaries to opentelemetry-collector-releases repository + +# One or more tracking issues or pull requests related to the change +issues: [10710] + +# (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: ocb will be released under open-telemetry/opentelemetry-collector-releases tagged as "cmd/builder/vX.XXX.X" + +# 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] diff --git a/.github/workflows/check-goreleaser.yaml b/.github/workflows/check-goreleaser.yaml deleted file mode 100644 index 875b4b17f7c..00000000000 --- a/.github/workflows/check-goreleaser.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Check GoReleaser Config -on: - push: - branches: [main] - tags: - - "v[0-9]+.[0-9]+.[0-9]+*" - pull_request: - -permissions: - contents: read - -jobs: - check: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 - with: - go-version: ~1.21.5 - - name: Check GoReleaser - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 - with: - distribution: goreleaser-pro - version: latest - args: check --verbose cmd/builder/.goreleaser.yml - env: - GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/builder-release.yaml b/.github/workflows/sourcecode-release.yaml similarity index 72% rename from .github/workflows/builder-release.yaml rename to .github/workflows/sourcecode-release.yaml index b6ae4795adb..7e767539fc9 100644 --- a/.github/workflows/builder-release.yaml +++ b/.github/workflows/sourcecode-release.yaml @@ -1,9 +1,9 @@ -name: Builder - Release +name: Source Code - Release on: push: tags: - - 'v*' + - "v*" jobs: goreleaser: @@ -13,19 +13,6 @@ jobs: uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 - with: - go-version: ~1.21.5 - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 - with: - distribution: goreleaser-pro - version: latest - args: release --clean -f cmd/builder/.goreleaser.yml - env: - GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Github Release run: | gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -n "### Images and binaries here: https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/${{ github.ref_name }}" diff --git a/cmd/builder/.goreleaser.yml b/cmd/builder/.goreleaser.yml deleted file mode 100644 index a964ac6c6ee..00000000000 --- a/cmd/builder/.goreleaser.yml +++ /dev/null @@ -1,39 +0,0 @@ -before: - hooks: - - go mod download -monorepo: - tag_prefix: cmd/builder/ - dir: cmd/builder -builds: - - flags: - - -trimpath - ldflags: - - -s -w -X go.opentelemetry.io/collector/cmd/builder/internal.version={{.Version}} -X go.opentelemetry.io/collector/cmd/builder/internal.date={{.Date}} - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm64 - - ppc64le - ignore: - - goos: windows - goarch: arm64 - binary: ocb -release: - github: - owner: open-telemetry - name: opentelemetry-collector - header: | - ### Images and binaries here: https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/{{ .Tag }} -archives: - - format: binary -checksum: - name_template: "checksums.txt" -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - disable: true diff --git a/docs/release.md b/docs/release.md index 38dad9e75cb..83db451d913 100644 --- a/docs/release.md +++ b/docs/release.md @@ -46,9 +46,7 @@ It is possible that a core approver isn't a contrib approver. In that case, the If you set your remote using `https` you need to include `REMOTE=https://github.com/open-telemetry/opentelemetry-collector.git` in each command. Wait for the new tag build to pass successfully. -6. The release script for the collector builder should create a new GitHub release for the builder. This is a separate release from the core, but we might join them in the future if it makes sense. - -7. A new `v0.85.0` release should be automatically created on Github by now. Edit it and use the contents from the CHANGELOG.md and CHANGELOG-API.md as the release's description. +6. A new `v0.85.0` source code release should be automatically created on Github by now. Edit it and use the contents from the CHANGELOG.md and CHANGELOG-API.md as the release's description. ## Releasing opentelemetry-collector-contrib @@ -74,17 +72,18 @@ It is possible that a core approver isn't a contrib approver. In that case, the 5. A new `v0.85.0` release should be automatically created on Github by now. Edit it and use the contents from the CHANGELOG.md as the release's description. ## Producing the artifacts - The last step of the release process creates artifacts for the new version of the collector and publishes images to Dockerhub. The steps in this portion of the release are done in the [opentelemetry-collector-releases](https://github.com/open-telemetry/opentelemetry-collector-releases) repo. -1. Update the `./distribution/**/manifest.yaml` files to include the new release version. +1. Update the `./distributions/**/manifest.yaml` files to include the new release version. 2. Update the builder version in `OTELCOL_BUILDER_VERSION` to the new release in the `Makefile`. While this might not be strictly necessary for every release, this is a good practice. -3. Create a pull request with the change and ensure the build completes successfully. See [example](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/71). +3. Create and push a new branch with this change, and apply the tag `cmd/builder/v0.xxx.0` to match the version number used above by running the command `make push-tags TAG=cmd/builder/v0.xxx.0`. This will build and release the ocb binaries under the opentelemetry-collector-releases distribution and is required to be completed **before** creating the pull request to merge the branch in the next step below. Building the distributions relies on using the latest ocb binary and if this workflow does not complete successfully, the rest of the build/release actions may not complete successfully. + +4. Create a pull request with the change and ensure the build completes successfully. See [example](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/71). This pull request will also initiate and release the opentelemetry collector builder (ocb) binaries in a separate release; this is required to use the newest ocb binary to build the collector distributions below. - 🛑 **Do not move forward until this PR is merged.** 🛑 -4. Check out the commit created by merging the PR and tag with the new release version by running the `make push-tags TAG=v0.85.0` command. If you set your remote using `https` you need to include `REMOTE=https://github.com/open-telemetry/opentelemetry-collector-releases.git` in each command. Wait for the new tag build to pass successfully. +5. Check out the commit created by merging the PR and tag with the new release version by running the `make push-tags TAG=v0.85.0` command. If you set your remote using `https` you need to include `REMOTE=https://github.com/open-telemetry/opentelemetry-collector-releases.git` in each command. Wait for the new tag build to pass successfully. 5. Ensure the "Release Core", "Release Contrib" and "Release k8s" actions pass, this will