From b9eefb8db222e97e10661dc09196f82131c3e18b Mon Sep 17 00:00:00 2001 From: Harry Date: Fri, 1 Nov 2024 14:52:06 -0700 Subject: [PATCH 01/11] Add checksum for wheel artifact and also add version.txt --- .github/workflows/release-build.yml | 21 +++++++++++++++++++++ checksum.txt | 0 version.txt | 0 3 files changed, 21 insertions(+) create mode 100644 checksum.txt create mode 100644 version.txt diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 5ddb016af7..9e6fa37e17 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -127,3 +127,24 @@ jobs: --draft \ "v${{ github.event.inputs.version }}" \ aws-opentelemetry-agent.jar + + - name: Get SHA256 checksum of wheel file + id: get_sha256 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + checksum=$(shasum -a 256 aws-opentelemetry-agent.jar | awk '{ print $1 }') + echo "CHECKSUM=$checksum" >> $GITHUB_OUTPUT + + - name: Append checksum and update version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "${{ github.event.inputs.version }} ${{ steps.get_sha256.outputs.CHECKSUM }}" >> checksum.txt + echo "${{ github.event.inputs.version }}" > version.txt + + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "GitHub Action Release Workflow" + git add checksum.txt version.txt + git commit -m "Update latest version and append checksum" + git push diff --git a/checksum.txt b/checksum.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/version.txt b/version.txt new file mode 100644 index 0000000000..e69de29bb2 From 7028ba04e6f3ce3c43d0a0022a7e50d8164f0122 Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:38:31 -0800 Subject: [PATCH 02/11] Test --- .../workflows/post_release_version_bump.yml | 137 ++++++++++++++++++ .../javaagent/providers/Version.java | 26 ++++ .../javaagent/providers/version.java | 20 +++ 3 files changed, 183 insertions(+) create mode 100644 .github/workflows/post_release_version_bump.yml create mode 100644 awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java create mode 100644 awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml new file mode 100644 index 0000000000..634478b3d9 --- /dev/null +++ b/.github/workflows/post_release_version_bump.yml @@ -0,0 +1,137 @@ +name: Post Release - Prepare Main for Next Development Cycle + +on: + workflow_dispatch: + inputs: + version: + description: 'Version number (e.g., 1.0.1)' + required: true + +env: + AWS_DEFAULT_REGION: us-east-1 + +permissions: + id-token: write + contents: write + pull-requests: write + +jobs: + check-version: + runs-on: ubuntu-latest + steps: + - name: Checkout main + uses: actions/checkout@v2 + with: + ref: main + fetch-depth: 0 + + - name: Extract Major.Minor Version and setup Env variable + run: | + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV + + - name: Get current major.minor version from main branch + id: get_version + run: | + CURRENT_VERSION=$(grep 'public static string version' awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java | sed -E 's/ public static String VERSION = "([0-9]+\.[0-9]+)\.[0-9]+.*";/\1/') + echo "CURRENT_MAJOR_MINOR_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV + + - name: Set major and minor for current version + run: | + echo "CURRENT_MAJOR=$(echo $CURRENT_MAJOR_MINOR_VERSION | cut -d. -f1)" >> $GITHUB_ENV + echo "CURRENT_MINOR=$(echo $CURRENT_MAJOR_MINOR_VERSION | cut -d. -f2)" >> $GITHUB_ENV + + - name: Set major and minor for input version + run: | + echo "INPUT_MAJOR=$(echo $MAJOR_MINOR | cut -d. -f1)" >> $GITHUB_ENV + echo "INPUT_MINOR=$(echo $MAJOR_MINOR | cut -d. -f2)" >> $GITHUB_ENV + + - name: Compare major.minor version and skip if behind + run: | + if [ "$CURRENT_MAJOR" -gt "$INPUT_MAJOR" ] || { [ "$CURRENT_MAJOR" -eq "$INPUT_MAJOR" ] && [ "$CURRENT_MINOR" -gt "$INPUT_MINOR" ]; }; then + echo "Input version is behind main's current major.minor version, don't need to update major version" + exit 1 + fi + + prepare-main: + runs-on: ubuntu-latest + needs: check-version + steps: + - name: Configure AWS credentials for BOT secrets + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + + - name: Get Bot secrets + uses: aws-actions/aws-secretsmanager-get-secrets@v1 + id: bot_secrets + with: + secret-ids: | + BOT_TOKEN ,${{ secrets.BOT_TOKEN_SECRET_ARN }} + parse-json-secrets: true + + - name: Setup Git + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} + + - name: Configure Git + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + + - name: Extract Major.Minor Version and setup Env variable + run: | + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV + + - name: Determine release branch and checkout + run: | + RELEASE_BRANCH="release/v${MAJOR_MINOR}.x" + git fetch origin $RELEASE_BRANCH + git checkout -b "prepare-main-for-next-dev-cycle-${VERSION}" origin/$RELEASE_BRANCH + + - name: Update version to next development version in main + # TODO update version in daily_scan.yml + run: | + DEV_VERSION="${{ github.event.inputs.version }}.dev0" + sed -i "s/public static String VERSION = \".*\";/public static String VERSION = \"${DEV_VERSION}\";/" awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java + VERSION="${{ github.event.inputs.version }}" + git add awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java + + - name: Append latest release checksum to release-build-metadata.json + run: | + ARTIFACT_NAME="aws-opentelemetry-agent.jar" + curl -L -o $ARTIFACT_NAME https://github.com/aws-observability/aws-otel-java-instrumentation/releases/download/v1.32.5/$ARTIFACT_NAME + + CHECKSUM=$(shasum -a 256 $ARTIFACT_NAME | awk '{ print $1 }') + + FILE="release-build-metadata.json" + UPDATED_JSON=$(jq --arg version "${{ env.VERSION }}" \ + --arg name "$ARTIFACT_NAME" \ + --arg checksum "$CHECKSUM" \ + '.release += [{"version": $version, "checksum": [{"name": $name, "checksum": $checksum}]}]' "$FILE") + + echo "$UPDATED_JSON" > "$FILE" + git add release-build-metadata.json + + - name: Push changes to Github + run: | + git commit -m "Prepare main for next development cycle: Update version to ${{ github.event.inputs.version }}" + git push --set-upstream origin "prepare-main-for-next-dev-cycle-${{ github.event.inputs.version }}" + + - name: Create Pull Request to main + env: + GITHUB_TOKEN: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} + run: | + DEV_VERSION="${{ github.event.inputs.version }}.dev0" + gh pr create --title "Post release $VERSION: Update version to $DEV_VERSION" \ + --body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION and updating the image version to be scanned to the latest released. + + This PR should only be merge when release for version v$VERSION is success. + + By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \ + --head prepare-main-for-next-dev-cycle-${VERSION} \ + --base main \ No newline at end of file diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java new file mode 100644 index 0000000000..fc25a71d55 --- /dev/null +++ b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java @@ -0,0 +1,26 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package software.amazon.opentelemetry.javaagent.providers; + +import io.opentelemetry.api.common.AttributeKey; + +/** Utility class holding attribute keys with special meaning to AWS components */ +final class AwsAttributeKeys { + + private AwsAttributeKeys() {} + + static final String VERSION = "1.32.5.dev0"; +} diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java new file mode 100644 index 0000000000..578b44d899 --- /dev/null +++ b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java @@ -0,0 +1,20 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package software.amazon.opentelemetry.javaagent.providers; + +static class Version { + public static String VERSION = "1.32.5.dev0"; +} From ce16c7fe7af6a564e4b74cf0ea328bf41874061a Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:39:57 -0800 Subject: [PATCH 03/11] Test --- .../workflows/post_release_version_bump.yml | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index 634478b3d9..8463f97213 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -6,6 +6,7 @@ on: version: description: 'Version number (e.g., 1.0.1)' required: true + push: env: AWS_DEFAULT_REGION: us-east-1 @@ -22,13 +23,13 @@ jobs: - name: Checkout main uses: actions/checkout@v2 with: - ref: main + ref: add-checksum fetch-depth: 0 - name: Extract Major.Minor Version and setup Env variable run: | - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV + echo "VERSION=1.32.5" >> $GITHUB_ENV + echo "MAJOR_MINOR=$(echo 1.32.5 | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV - name: Get current major.minor version from main branch id: get_version @@ -76,6 +77,7 @@ jobs: with: fetch-depth: 0 token: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} + ref: add-checksum - name: Configure Git run: | @@ -84,8 +86,8 @@ jobs: - name: Extract Major.Minor Version and setup Env variable run: | - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV + echo "VERSION=1.32.5" >> $GITHUB_ENV + echo "MAJOR_MINOR=$(echo 1.32.5 | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV - name: Determine release branch and checkout run: | @@ -96,9 +98,9 @@ jobs: - name: Update version to next development version in main # TODO update version in daily_scan.yml run: | - DEV_VERSION="${{ github.event.inputs.version }}.dev0" + DEV_VERSION="1.32.5.dev0" sed -i "s/public static String VERSION = \".*\";/public static String VERSION = \"${DEV_VERSION}\";/" awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java - VERSION="${{ github.event.inputs.version }}" + VERSION="1.32.5" git add awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java - name: Append latest release checksum to release-build-metadata.json @@ -119,14 +121,14 @@ jobs: - name: Push changes to Github run: | - git commit -m "Prepare main for next development cycle: Update version to ${{ github.event.inputs.version }}" - git push --set-upstream origin "prepare-main-for-next-dev-cycle-${{ github.event.inputs.version }}" + git commit -m "Prepare main for next development cycle: Update version to 1.32.5" + git push --set-upstream origin "prepare-main-for-next-dev-cycle-1.32.5" - name: Create Pull Request to main env: GITHUB_TOKEN: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} run: | - DEV_VERSION="${{ github.event.inputs.version }}.dev0" + DEV_VERSION="1.32.5.dev0" gh pr create --title "Post release $VERSION: Update version to $DEV_VERSION" \ --body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION and updating the image version to be scanned to the latest released. From c1ea02ca0baab2b52c8f2d011e242339a5e08f90 Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:42:03 -0800 Subject: [PATCH 04/11] Test --- release-build-metafile.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 release-build-metafile.json diff --git a/release-build-metafile.json b/release-build-metafile.json new file mode 100644 index 0000000000..fe46d3c6d4 --- /dev/null +++ b/release-build-metafile.json @@ -0,0 +1,13 @@ +{ + "release": [ + { + "version": "1.32.5", + "checksum": [ + { + "name": "aws-opentelemetry-agent.jar", + "checksum": "1644b11c2c90747c99934c3c52d800e95bfb854e459ba9f50054b21233c65c37" + } + ] + } + ] +} \ No newline at end of file From 668a5a1ed944fbaa63ece1c5dd7513098e3db68d Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:44:36 -0800 Subject: [PATCH 05/11] Test --- release-build-metafile.json => release-build-metadata.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename release-build-metafile.json => release-build-metadata.json (100%) diff --git a/release-build-metafile.json b/release-build-metadata.json similarity index 100% rename from release-build-metafile.json rename to release-build-metadata.json From 9c224aa70b7619d04afa06c039c9cef45d9805da Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:46:56 -0800 Subject: [PATCH 06/11] Test --- .../workflows/post_release_version_bump.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index 8463f97213..60fb8d6c5e 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -28,8 +28,8 @@ jobs: - name: Extract Major.Minor Version and setup Env variable run: | - echo "VERSION=1.32.5" >> $GITHUB_ENV - echo "MAJOR_MINOR=$(echo 1.32.5 | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV + echo "VERSION=1.32.7" >> $GITHUB_ENV + echo "MAJOR_MINOR=$(echo 1.32.7 | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV - name: Get current major.minor version from main branch id: get_version @@ -86,8 +86,8 @@ jobs: - name: Extract Major.Minor Version and setup Env variable run: | - echo "VERSION=1.32.5" >> $GITHUB_ENV - echo "MAJOR_MINOR=$(echo 1.32.5 | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV + echo "VERSION=1.32.7" >> $GITHUB_ENV + echo "MAJOR_MINOR=$(echo 1.32.7 | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV - name: Determine release branch and checkout run: | @@ -98,9 +98,9 @@ jobs: - name: Update version to next development version in main # TODO update version in daily_scan.yml run: | - DEV_VERSION="1.32.5.dev0" + DEV_VERSION="1.32.7.dev0" sed -i "s/public static String VERSION = \".*\";/public static String VERSION = \"${DEV_VERSION}\";/" awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java - VERSION="1.32.5" + VERSION="1.32.7" git add awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java - name: Append latest release checksum to release-build-metadata.json @@ -121,14 +121,14 @@ jobs: - name: Push changes to Github run: | - git commit -m "Prepare main for next development cycle: Update version to 1.32.5" - git push --set-upstream origin "prepare-main-for-next-dev-cycle-1.32.5" + git commit -m "Prepare main for next development cycle: Update version to 1.32.7" + git push --set-upstream origin "prepare-main-for-next-dev-cycle-1.32.7" - name: Create Pull Request to main env: GITHUB_TOKEN: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} run: | - DEV_VERSION="1.32.5.dev0" + DEV_VERSION="1.32.7.dev0" gh pr create --title "Post release $VERSION: Update version to $DEV_VERSION" \ --body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION and updating the image version to be scanned to the latest released. From 56b8ba48d5792394928a950dc868c1451785779e Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:50:47 -0800 Subject: [PATCH 07/11] Test --- .../workflows/post_release_version_bump.yml | 1 - .../javaagent/providers/Version.java | 2 +- .../javaagent/providers/version.java | 20 ------------------- 3 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index 60fb8d6c5e..9d28fea761 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -96,7 +96,6 @@ jobs: git checkout -b "prepare-main-for-next-dev-cycle-${VERSION}" origin/$RELEASE_BRANCH - name: Update version to next development version in main - # TODO update version in daily_scan.yml run: | DEV_VERSION="1.32.7.dev0" sed -i "s/public static String VERSION = \".*\";/public static String VERSION = \"${DEV_VERSION}\";/" awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java index fc25a71d55..aa122d52c2 100644 --- a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java +++ b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java @@ -22,5 +22,5 @@ final class AwsAttributeKeys { private AwsAttributeKeys() {} - static final String VERSION = "1.32.5.dev0"; + public static VERSION = "1.32.5.dev0"; } diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java deleted file mode 100644 index 578b44d899..0000000000 --- a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/version.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -package software.amazon.opentelemetry.javaagent.providers; - -static class Version { - public static String VERSION = "1.32.5.dev0"; -} From 2a0c63ef6baa3b11f38337b181e7a36cbdbbe5d5 Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 17:54:43 -0800 Subject: [PATCH 08/11] Test --- .github/workflows/release-build.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 9e6fa37e17..f549bc425f 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -126,25 +126,4 @@ jobs: --title "Release v${{ github.event.inputs.version }}" \ --draft \ "v${{ github.event.inputs.version }}" \ - aws-opentelemetry-agent.jar - - - name: Get SHA256 checksum of wheel file - id: get_sha256 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - checksum=$(shasum -a 256 aws-opentelemetry-agent.jar | awk '{ print $1 }') - echo "CHECKSUM=$checksum" >> $GITHUB_OUTPUT - - - name: Append checksum and update version - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "${{ github.event.inputs.version }} ${{ steps.get_sha256.outputs.CHECKSUM }}" >> checksum.txt - echo "${{ github.event.inputs.version }}" > version.txt - - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "GitHub Action Release Workflow" - git add checksum.txt version.txt - git commit -m "Update latest version and append checksum" - git push + aws-opentelemetry-agent.jar \ No newline at end of file From e5986b30c77be8cdf728cffb45ab241d19c7968a Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 18:12:15 -0800 Subject: [PATCH 09/11] Test --- .github/workflows/post_release_version_bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index 9d28fea761..dfd841d9e3 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -34,7 +34,7 @@ jobs: - name: Get current major.minor version from main branch id: get_version run: | - CURRENT_VERSION=$(grep 'public static string version' awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java | sed -E 's/ public static String VERSION = "([0-9]+\.[0-9]+)\.[0-9]+.*";/\1/') + CURRENT_VERSION=$(grep 'public static String VERSION' awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java | sed -E 's/ public static String VERSION = "([0-9]+\.[0-9]+)\.[0-9]+.*";/\1/') echo "CURRENT_MAJOR_MINOR_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV - name: Set major and minor for current version From bfe53c60db12e2314d15386a81effeeaa79ac9d7 Mon Sep 17 00:00:00 2001 From: Harry Date: Sun, 8 Dec 2024 18:20:16 -0800 Subject: [PATCH 10/11] Test --- .github/workflows/post_release_version_bump.yml | 4 ++-- .../providers/{Version.java => ArtifactVersion.java} | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) rename awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/{Version.java => ArtifactVersion.java} (71%) diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index dfd841d9e3..2035bb69ce 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -34,7 +34,7 @@ jobs: - name: Get current major.minor version from main branch id: get_version run: | - CURRENT_VERSION=$(grep 'public static String VERSION' awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java | sed -E 's/ public static String VERSION = "([0-9]+\.[0-9]+)\.[0-9]+.*";/\1/') + CURRENT_VERSION=$(grep 'public final String VERSION' awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java | sed -E 's/ public final String VERSION = "([0-9]+\.[0-9]+)\.[0-9]+.*";/\1/') echo "CURRENT_MAJOR_MINOR_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV - name: Set major and minor for current version @@ -98,7 +98,7 @@ jobs: - name: Update version to next development version in main run: | DEV_VERSION="1.32.7.dev0" - sed -i "s/public static String VERSION = \".*\";/public static String VERSION = \"${DEV_VERSION}\";/" awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java + sed -i "s/public final String VERSION = \".*\";/public final String VERSION = \"${DEV_VERSION}\";/" awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java VERSION="1.32.7" git add awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java similarity index 71% rename from awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java rename to awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java index aa122d52c2..ef93b91cca 100644 --- a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/Version.java +++ b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java @@ -15,12 +15,6 @@ package software.amazon.opentelemetry.javaagent.providers; -import io.opentelemetry.api.common.AttributeKey; - -/** Utility class holding attribute keys with special meaning to AWS components */ -final class AwsAttributeKeys { - - private AwsAttributeKeys() {} - - public static VERSION = "1.32.5.dev0"; -} +public final class ArtifactVersion { + public final String VERSION = "1.32.5.dev0"; +} \ No newline at end of file From ebfce44b6879cdfd942c75f8a94f34ff79528e2e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 Dec 2024 02:21:53 +0000 Subject: [PATCH 11/11] Prepare main for next development cycle: Update version to 1.32.7 --- .../javaagent/providers/ArtifactVersion.java | 2 +- release-build-metadata.json | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java index ef93b91cca..617ba77188 100644 --- a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java +++ b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/ArtifactVersion.java @@ -16,5 +16,5 @@ package software.amazon.opentelemetry.javaagent.providers; public final class ArtifactVersion { - public final String VERSION = "1.32.5.dev0"; + public final String VERSION = "1.32.7.dev0"; } \ No newline at end of file diff --git a/release-build-metadata.json b/release-build-metadata.json index fe46d3c6d4..a87150ae2f 100644 --- a/release-build-metadata.json +++ b/release-build-metadata.json @@ -1,13 +1,22 @@ { - "release": [ + "release": [ + { + "version": "1.32.5", + "checksum": [ { - "version": "1.32.5", - "checksum": [ - { - "name": "aws-opentelemetry-agent.jar", - "checksum": "1644b11c2c90747c99934c3c52d800e95bfb854e459ba9f50054b21233c65c37" - } - ] + "name": "aws-opentelemetry-agent.jar", + "checksum": "1644b11c2c90747c99934c3c52d800e95bfb854e459ba9f50054b21233c65c37" } - ] -} \ No newline at end of file + ] + }, + { + "version": "1.32.7", + "checksum": [ + { + "name": "aws-opentelemetry-agent.jar", + "checksum": "1644b11c2c90747c99934c3c52d800e95bfb854e459ba9f50054b21233c65c37" + } + ] + } + ] +}