From 95e257f86271ade22b436f18c51ccc702494066a Mon Sep 17 00:00:00 2001 From: asr-alurisanthoshreddy Date: Mon, 11 Aug 2025 06:12:20 -0900 Subject: [PATCH 01/10] ci: automate pre- and post-release version bump to include -DEV in main --- .github/workflows/post-release-bump.yml | 58 +++++++++++++++++++++++++ .github/workflows/pre-release.yml | 54 +++++++++++++++++++++++ api/include/opentelemetry/version.h | 6 +-- 3 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/post-release-bump.yml create mode 100644 .github/workflows/pre-release.yml diff --git a/.github/workflows/post-release-bump.yml b/.github/workflows/post-release-bump.yml new file mode 100644 index 0000000000..ee6a878bf0 --- /dev/null +++ b/.github/workflows/post-release-bump.yml @@ -0,0 +1,58 @@ +name: Post-Release Version Bump + +on: + push: + tags: + - 'v*.*.*' + +jobs: + bump-version: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v4 + with: + ref: main + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract release version and decide bump type + run: | + TAG_VERSION="${GITHUB_REF#refs/tags/v}" + echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV + + MAJOR=$(echo "$TAG_VERSION" | cut -d. -f1) + MINOR=$(echo "$TAG_VERSION" | cut -d. -f2) + PATCH=$(echo "$TAG_VERSION" | cut -d. -f3) + + if [ "$PATCH" -gt 0 ]; then + # Patch release → bump patch + NEW_MAJOR=$MAJOR + NEW_MINOR=$MINOR + NEW_PATCH=$((PATCH + 1)) + else + # Minor release → bump minor, reset patch + NEW_MAJOR=$MAJOR + NEW_MINOR=$((MINOR + 1)) + NEW_PATCH=0 + fi + + echo "NEW_MAJOR=$NEW_MAJOR" >> $GITHUB_ENV + echo "NEW_MINOR=$NEW_MINOR" >> $GITHUB_ENV + echo "NEW_PATCH=$NEW_PATCH" >> $GITHUB_ENV + + - name: Update version.h to DEV version + run: | + FILE_PATH="include/opentelemetry/version.h" + sed -i "s|#define OPENTELEMETRY_VERSION \".*\"|#define OPENTELEMETRY_VERSION \"${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}-DEV\"|" "$FILE_PATH" + sed -i "s|#define OPENTELEMETRY_VERSION_MAJOR .*|#define OPENTELEMETRY_VERSION_MAJOR ${NEW_MAJOR}|" "$FILE_PATH" + sed -i "s|#define OPENTELEMETRY_VERSION_MINOR .*|#define OPENTELEMETRY_VERSION_MINOR ${NEW_MINOR}|" "$FILE_PATH" + sed -i "s|#define OPENTELEMETRY_VERSION_PATCH .*|#define OPENTELEMETRY_VERSION_PATCH ${NEW_PATCH}|" "$FILE_PATH" + + - name: Commit and push changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add include/opentelemetry/version.h + git commit -m "Bump version to ${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}-DEV after release" || echo "No changes to commit" + git push origin main + diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000000..3df6520995 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,54 @@ +name: Pre-Release Preparation + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g. 1.23.0)' + required: true + type: string + +jobs: + prepare-release: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v4 + with: + ref: main + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Validate current version contains -DEV + run: | + FILE_PATH="include/opentelemetry/version.h" + if ! grep -q -- "-DEV" "$FILE_PATH"; then + echo "Error: version.h does not contain -DEV. Aborting to prevent overwriting a release." + exit 1 + fi + + - name: Remove -DEV from version.h + run: | + FILE_PATH="include/opentelemetry/version.h" + VERSION="${{ github.event.inputs.version }}" + + MAJOR=$(echo "$VERSION" | cut -d. -f1) + MINOR=$(echo "$VERSION" | cut -d. -f2) + PATCH=$(echo "$VERSION" | cut -d. -f3) + + sed -i "s|#define OPENTELEMETRY_VERSION \".*\"|#define OPENTELEMETRY_VERSION \"${VERSION}\"|" "$FILE_PATH" + sed -i "s|#define OPENTELEMETRY_VERSION_MAJOR .*|#define OPENTELEMETRY_VERSION_MAJOR ${MAJOR}|" "$FILE_PATH" + sed -i "s|#define OPENTELEMETRY_VERSION_MINOR .*|#define OPENTELEMETRY_VERSION_MINOR ${MINOR}|" "$FILE_PATH" + sed -i "s|#define OPENTELEMETRY_VERSION_PATCH .*|#define OPENTELEMETRY_VERSION_PATCH ${PATCH}|" "$FILE_PATH" + + - name: Commit clean release version + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add include/opentelemetry/version.h + git commit -m "Prepare release ${{ github.event.inputs.version }}" || echo "No changes to commit" + git push origin main + + - name: Create and push tag + run: | + git tag -a "v${{ github.event.inputs.version }}" -m "Release v${{ github.event.inputs.version }}" + git push origin "v${{ github.event.inputs.version }}" diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h index ab69ca02f2..75f87835be 100644 --- a/api/include/opentelemetry/version.h +++ b/api/include/opentelemetry/version.h @@ -10,9 +10,10 @@ # define OPENTELEMETRY_ABI_VERSION_NO 1 #endif -#define OPENTELEMETRY_VERSION "1.22.0" +// Development version after 1.22.0 release +#define OPENTELEMETRY_VERSION "1.23.0-DEV" #define OPENTELEMETRY_VERSION_MAJOR 1 -#define OPENTELEMETRY_VERSION_MINOR 22 +#define OPENTELEMETRY_VERSION_MINOR 23 #define OPENTELEMETRY_VERSION_PATCH 0 #define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO) @@ -25,5 +26,4 @@ }} #define OPENTELEMETRY_NAMESPACE opentelemetry :: OPENTELEMETRY_CONCAT(v, OPENTELEMETRY_ABI_VERSION_NO) - // clang-format on From 2b7f89af4c0db1104bd6507ea657aadd328001e1 Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:23:25 -0900 Subject: [PATCH 02/10] Update .github/workflows/post-release-bump.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/post-release-bump.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-release-bump.yml b/.github/workflows/post-release-bump.yml index ee6a878bf0..3fb67b826d 100644 --- a/.github/workflows/post-release-bump.yml +++ b/.github/workflows/post-release-bump.yml @@ -34,7 +34,10 @@ jobs: NEW_MAJOR=$MAJOR NEW_MINOR=$((MINOR + 1)) NEW_PATCH=0 - fi + # Always bump minor version and reset patch + NEW_MAJOR=$MAJOR + NEW_MINOR=$((MINOR + 1)) + NEW_PATCH=0 echo "NEW_MAJOR=$NEW_MAJOR" >> $GITHUB_ENV echo "NEW_MINOR=$NEW_MINOR" >> $GITHUB_ENV From 318212900c735ae049d170584c34171880b8b874 Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:23:39 -0900 Subject: [PATCH 03/10] Update .github/workflows/pre-release.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 3df6520995..ff40efe209 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -20,7 +20,7 @@ jobs: - name: Validate current version contains -DEV run: | - FILE_PATH="include/opentelemetry/version.h" + FILE_PATH="api/include/opentelemetry/version.h" if ! grep -q -- "-DEV" "$FILE_PATH"; then echo "Error: version.h does not contain -DEV. Aborting to prevent overwriting a release." exit 1 From 8d762493ee624eec62413af0efd7a8ab0deeb9f9 Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:23:50 -0900 Subject: [PATCH 04/10] Update .github/workflows/pre-release.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index ff40efe209..d185341bc8 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -44,7 +44,7 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add include/opentelemetry/version.h + git add api/include/opentelemetry/version.h git commit -m "Prepare release ${{ github.event.inputs.version }}" || echo "No changes to commit" git push origin main From 517122cdc40fdbf1d5725b1058afe3df5f4f925a Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:23:58 -0900 Subject: [PATCH 05/10] Update .github/workflows/pre-release.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d185341bc8..a9028296e4 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -28,7 +28,7 @@ jobs: - name: Remove -DEV from version.h run: | - FILE_PATH="include/opentelemetry/version.h" + FILE_PATH="api/include/opentelemetry/version.h" VERSION="${{ github.event.inputs.version }}" MAJOR=$(echo "$VERSION" | cut -d. -f1) From 0db4dcb0d88f8e718651aa2886055b4fe5976955 Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:24:10 -0900 Subject: [PATCH 06/10] Update .github/workflows/post-release-bump.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/post-release-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-release-bump.yml b/.github/workflows/post-release-bump.yml index 3fb67b826d..0f0537bb36 100644 --- a/.github/workflows/post-release-bump.yml +++ b/.github/workflows/post-release-bump.yml @@ -45,7 +45,7 @@ jobs: - name: Update version.h to DEV version run: | - FILE_PATH="include/opentelemetry/version.h" + FILE_PATH="api/include/opentelemetry/version.h" sed -i "s|#define OPENTELEMETRY_VERSION \".*\"|#define OPENTELEMETRY_VERSION \"${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}-DEV\"|" "$FILE_PATH" sed -i "s|#define OPENTELEMETRY_VERSION_MAJOR .*|#define OPENTELEMETRY_VERSION_MAJOR ${NEW_MAJOR}|" "$FILE_PATH" sed -i "s|#define OPENTELEMETRY_VERSION_MINOR .*|#define OPENTELEMETRY_VERSION_MINOR ${NEW_MINOR}|" "$FILE_PATH" From 704cfa1a4fd08970f75df9d8cb54c65faac72148 Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:24:19 -0900 Subject: [PATCH 07/10] Update .github/workflows/post-release-bump.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/post-release-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-release-bump.yml b/.github/workflows/post-release-bump.yml index 0f0537bb36..0e3db2b716 100644 --- a/.github/workflows/post-release-bump.yml +++ b/.github/workflows/post-release-bump.yml @@ -55,7 +55,7 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add include/opentelemetry/version.h + git add api/include/opentelemetry/version.h git commit -m "Bump version to ${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}-DEV after release" || echo "No changes to commit" git push origin main From a809720e29ea45e26d501afdd9cfedd840a6411d Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:47:41 -0900 Subject: [PATCH 08/10] Update post-release-bump.yml Error Correction --- .github/workflows/post-release-bump.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/post-release-bump.yml b/.github/workflows/post-release-bump.yml index 0e3db2b716..0a8a3fcdef 100644 --- a/.github/workflows/post-release-bump.yml +++ b/.github/workflows/post-release-bump.yml @@ -19,21 +19,10 @@ jobs: run: | TAG_VERSION="${GITHUB_REF#refs/tags/v}" echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV - MAJOR=$(echo "$TAG_VERSION" | cut -d. -f1) MINOR=$(echo "$TAG_VERSION" | cut -d. -f2) PATCH=$(echo "$TAG_VERSION" | cut -d. -f3) - if [ "$PATCH" -gt 0 ]; then - # Patch release → bump patch - NEW_MAJOR=$MAJOR - NEW_MINOR=$MINOR - NEW_PATCH=$((PATCH + 1)) - else - # Minor release → bump minor, reset patch - NEW_MAJOR=$MAJOR - NEW_MINOR=$((MINOR + 1)) - NEW_PATCH=0 # Always bump minor version and reset patch NEW_MAJOR=$MAJOR NEW_MINOR=$((MINOR + 1)) @@ -45,7 +34,7 @@ jobs: - name: Update version.h to DEV version run: | - FILE_PATH="api/include/opentelemetry/version.h" + FILE_PATH="include/opentelemetry/version.h" sed -i "s|#define OPENTELEMETRY_VERSION \".*\"|#define OPENTELEMETRY_VERSION \"${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}-DEV\"|" "$FILE_PATH" sed -i "s|#define OPENTELEMETRY_VERSION_MAJOR .*|#define OPENTELEMETRY_VERSION_MAJOR ${NEW_MAJOR}|" "$FILE_PATH" sed -i "s|#define OPENTELEMETRY_VERSION_MINOR .*|#define OPENTELEMETRY_VERSION_MINOR ${NEW_MINOR}|" "$FILE_PATH" @@ -55,7 +44,6 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add api/include/opentelemetry/version.h + git add include/opentelemetry/version.h git commit -m "Bump version to ${NEW_MAJOR}.${NEW_MINOR}.${NEW_PATCH}-DEV after release" || echo "No changes to commit" git push origin main - From cdb44d6d61185e69e29821cf08178aa35ba4905a Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:01:23 -0900 Subject: [PATCH 09/10] Update version.h --- api/include/opentelemetry/version.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h index 75f87835be..36587fd8da 100644 --- a/api/include/opentelemetry/version.h +++ b/api/include/opentelemetry/version.h @@ -10,8 +10,12 @@ # define OPENTELEMETRY_ABI_VERSION_NO 1 #endif +// Release version +#define OPENTELEMETRY_VERSION "1.23.0" + // Development version after 1.22.0 release -#define OPENTELEMETRY_VERSION "1.23.0-DEV" +#define OPENTELEMETRY_VERSION_DEV "1.23.0-DEV" + #define OPENTELEMETRY_VERSION_MAJOR 1 #define OPENTELEMETRY_VERSION_MINOR 23 #define OPENTELEMETRY_VERSION_PATCH 0 From 49cf1ff36e6956d69f3d1753cf9ff32310f48301 Mon Sep 17 00:00:00 2001 From: ALURI SANTHOSH REDDY <162683267+asr-alurisanthoshreddy@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:59:57 -0900 Subject: [PATCH 10/10] Update version.h --- api/include/opentelemetry/version.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/include/opentelemetry/version.h b/api/include/opentelemetry/version.h index 36587fd8da..63b296498b 100644 --- a/api/include/opentelemetry/version.h +++ b/api/include/opentelemetry/version.h @@ -10,14 +10,12 @@ # define OPENTELEMETRY_ABI_VERSION_NO 1 #endif -// Release version -#define OPENTELEMETRY_VERSION "1.23.0" - -// Development version after 1.22.0 release -#define OPENTELEMETRY_VERSION_DEV "1.23.0-DEV" +// Development version after 1.23.0 release +#define OPENTELEMETRY_VERSION "1.24.0-DEV" +#define OPENTELEMETRY_VERSION_DEV "1.24.0-DEV" #define OPENTELEMETRY_VERSION_MAJOR 1 -#define OPENTELEMETRY_VERSION_MINOR 23 +#define OPENTELEMETRY_VERSION_MINOR 24 #define OPENTELEMETRY_VERSION_PATCH 0 #define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)