Automation - Prepare Release #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-beta: | |
type: choice | |
required: true | |
description: Select what kind of version bump this should be | |
options: | |
- minor | |
- patch | |
jobs: | |
# Releasing opentelemetry-collector-contrib | |
prepare-release: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 | |
repository: "open-telemetry/opentelemetry-collector" | |
path: opentelemetry-collector | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 | |
path: opentelemetry-collector-contrib | |
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5 | |
with: | |
go-version: "1.23.7" | |
cache: false | |
- name: Get Previous tag | |
id: previous-version | |
uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1.4.0 | |
with: | |
prefix: v | |
workingDirectory: opentelemetry-collector-contrib | |
- name: Get next minor version | |
id: semvers | |
uses: WyriHaximus/github-action-next-semvers@18aa9ed4152808ab99b88d71f5481e41f8d89930 # v1.2.1 | |
with: | |
version: ${{ steps.previous-version.outputs.tag }} | |
- name: Select next version | |
id: next-version | |
run: | | |
if [[ '${{ inputs.candidate-beta }}' == 'minor' ]]; then | |
echo "next-version=${{ steps.semvers.outputs.minor }}" >> $GITHUB_OUTPUT | |
elif [[ '${{ inputs.candidate-beta }}' == 'patch' ]]; then | |
echo "next-version=${{ steps.semvers.outputs.patch }}" >> $GITHUB_OUTPUT | |
else | |
echo "Error: unsupported semver type" | |
exit 1 | |
fi | |
- name: Prepare release for contrib | |
working-directory: opentelemetry-collector-contrib | |
env: | |
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} | |
REPO: open-telemetry/opentelemetry-collector-contrib | |
CANDIDATE_BETA: ${{ steps.next-version.outputs.next-version }} | |
CURRENT_BETA: ${{ steps.previous-version.outputs.tag }} | |
run: ./.github/workflows/scripts/release-prepare-release.sh |