diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index 6d53768c5..546d07ec5 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -8,6 +8,8 @@ on: required: true env: + VERSION: ${{ github.event.inputs.version }} + AWS_DEFAULT_REGION: us-east-1 permissions: @@ -96,9 +98,9 @@ jobs: - name: Update version to next development version in main run: | - DEV_VERSION="${{ github.event.inputs.version }}.dev0" + DEV_VERSION="${{ env.VERSION }}.dev0" sed -i 's/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py - VERSION="${{ github.event.inputs.version }}" + VERSION="${{ env.VERSION }}" sed -i 's/python:v.*"/python:v'$VERSION'"/' .github/workflows/daily_scan.yml git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py git add .github/workflows/daily_scan.yml @@ -109,7 +111,7 @@ jobs: env: GITHUB_TOKEN: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} run: | - DEV_VERSION="${{ github.event.inputs.version }}.dev0" + DEV_VERSION="${{ env.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. diff --git a/.github/workflows/pre_release_prepare.yml b/.github/workflows/pre_release_prepare.yml index a6f83cc73..738288734 100644 --- a/.github/workflows/pre_release_prepare.yml +++ b/.github/workflows/pre_release_prepare.yml @@ -12,6 +12,9 @@ on: default: 'false' env: + VERSION: ${{ github.event.inputs.version }} + IS_PATCH: ${{ github.event.inputs.is_patch }} + AWS_DEFAULT_REGION: us-east-1 permissions: @@ -56,7 +59,7 @@ jobs: - name: Create branches run: | - IS_PATCH=${{ github.event.inputs.is_patch }} + IS_PATCH=${{ env.IS_PATCH }} if [[ "$IS_PATCH" != "true" && "$IS_PATCH" != "false" ]]; then echo "Invalid input for IS_PATCH. Must be 'true' or 'false'." exit 1 @@ -102,5 +105,5 @@ jobs: --body "This PR updates the version to ${VERSION}. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \ - --head v${{ github.event.inputs.version }}_release \ + --head v${{ env.VERSION }}_release \ --base release/v${MAJOR_MINOR}.x \ No newline at end of file diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 7214547d6..58fd2abfe 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -7,6 +7,8 @@ on: required: true env: + VERSION: ${{ github.event.inputs.version }} + AWS_DEFAULT_REGION: us-east-1 AWS_PUBLIC_ECR_REGION: us-east-1 AWS_PRIVATE_ECR_REGION: us-west-2 @@ -14,8 +16,7 @@ env: RELEASE_PRIVATE_REPOSITORY: 020628701572.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-python RELEASE_PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com PACKAGE_NAME: aws-opentelemetry-distro - ARTIFACT_NAME: aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl - + ARTIFACT_NAME: aws_opentelemetry_distro-${{ env.VERSION }}-py3-none-any.whl permissions: id-token: write contents: write @@ -108,7 +109,7 @@ jobs: file: ./Dockerfile platforms: linux/amd64,linux/arm64 tags: | - ${{ env.RELEASE_PUBLIC_REPOSITORY }}:v${{ github.event.inputs.version }} + ${{ env.RELEASE_PUBLIC_REPOSITORY }}:v${{ env.VERSION }} # Publish to private ECR - name: Build and push private ECR image @@ -119,7 +120,7 @@ jobs: file: ./Dockerfile platforms: linux/amd64,linux/arm64 tags: | - ${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }} + ${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ env.VERSION }} - name: Get SHA256 checksum of wheel file id: get_sha256 @@ -133,8 +134,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token run: | gh release create --target "$GITHUB_REF_NAME" \ - --title "Release v${{ github.event.inputs.version }}" \ + --title "Release v${{ env.VERSION }}" \ --draft \ - "v${{ github.event.inputs.version }}" \ + "v${{ env.VERSION }}" \ dist/${{ env.ARTIFACT_NAME }} \ ${{ env.ARTIFACT_NAME }}.sha256 \ No newline at end of file diff --git a/.github/workflows/release_lambda.yml b/.github/workflows/release_lambda.yml index 3e02b0b35..a4c8ca9ac 100644 --- a/.github/workflows/release_lambda.yml +++ b/.github/workflows/release_lambda.yml @@ -12,6 +12,10 @@ on: default: 'us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-3, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1, sa-east-1, af-south-1, ap-east-1, ap-south-2, ap-southeast-3, ap-southeast-4, eu-central-2, eu-south-1, eu-south-2, il-central-1, me-central-1, me-south-1' env: + VERSION: ${{ github.event.inputs.version }} + AWS_REGIONS: ${{ github.event.inputs.aws_region }} + + COMMERCIAL_REGIONS: us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-3, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1, sa-east-1 LAYER_NAME: AWSOpenTelemetryDistroPython @@ -28,7 +32,7 @@ jobs: - name: Set up regions matrix id: set-matrix run: | - IFS=',' read -ra REGIONS <<< "${{ github.event.inputs.aws_region }}" + IFS=',' read -ra REGIONS <<< "${{ env.AWS_REGIONS }}" MATRIX="[" for region in "${REGIONS[@]}"; do trimmed_region=$(echo "$region" | xargs) @@ -193,7 +197,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token run: | gh release create --target "$GITHUB_REF_NAME" \ - --title "Release lambda-v${{ github.event.inputs.version }}" \ + --title "Release lambda-v${{ env.VERSION }}" \ --draft \ - "lambda-v${{ github.event.inputs.version }}" \ + "lambda-v${{ env.VERSION }}" \ layer.tf