1111 description : Comma separated list of commit shas to cherrypick
1212
1313env :
14+ VERSION : ${{ env.VERSION }}
15+ COMMITS : ${{ env.COMMITS }}
1416 AWS_DEFAULT_REGION : us-east-1
1517 TEST_TAG : public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test-v2
1618
3032 name : Parse release branch name
3133 run : |
3234 # Sets the release-branch-name output to the version number with the last non-period element replaced with an 'x' and preprended with v.
33- echo "release-branch-name=$(echo '${{ github.event.inputs.version }}' | sed -E 's/([^.]+)\.([^.]+)\.([^.]+)/v\1.\2.x/')" >> $GITHUB_OUTPUT
35+ echo "release-branch-name=$(echo '${{ env.VERSION }}' | sed -E 's/([^.]+)\.([^.]+)\.([^.]+)/v\1.\2.x/')" >> $GITHUB_OUTPUT
3436 # Sets the release-tag-name output to the version number with the last non-period element replace with a '0' and prepended with v
35- echo "release-tag-name=$(echo '${{ github.event.inputs.version }}' | sed -E 's/([^.]+)\.([^.]+)\.([^.]+)/v\1.\2.0/')" >> $GITHUB_OUTPUT
37+ echo "release-tag-name=$(echo '${{ env.VERSION }}' | sed -E 's/([^.]+)\.([^.]+)\.([^.]+)/v\1.\2.0/')" >> $GITHUB_OUTPUT
3638 - id : checkout-release-branch
3739 name : Check out release branch
3840 # Will fail if there is no release branch yet or succeed otherwise
@@ -84,15 +86,15 @@ jobs:
8486 if : ${{ github.event.inputs.commits != '' }}
8587 run : |
8688 git fetch origin main
87- echo ${{ github.event.inputs.commits }} | sed -n 1'p' | tr ',' '\n' | while read word; do
89+ echo ${{ env.COMMITS }} | sed -n 1'p' | tr ',' '\n' | while read word; do
8890 # Trim whitespaces and cherrypick
8991 echo $word | sed 's/ *$//g' | sed 's/^ *//g' | git cherry-pick --stdin
9092 done
9193
9294 - name : Build release with Gradle
9395 uses : gradle/gradle-build-action@v3
9496 with :
95- arguments : build integrationTests -PlocalDocker=true -Prelease.version=${{ github.event.inputs.version }} --stacktrace
97+ arguments : build integrationTests -PlocalDocker=true -Prelease.version=${{ env.VERSION }} --stacktrace
9698
9799 - name : Configure AWS Credentials
98100 uses : aws-actions/configure-aws-credentials@v4
@@ -117,30 +119,30 @@ jobs:
117119 uses : docker/build-push-action@v5
118120 with :
119121 push : false
120- build-args : " ADOT_JAVA_VERSION=${{ github.event.inputs.version }}"
122+ build-args : " ADOT_JAVA_VERSION=${{ env.VERSION }}"
121123 context : .
122124 platforms : linux/amd64
123125 tags : ${{ env.TEST_TAG }}
124126 load : true
125127
126128 - name : Test docker image
127129 shell : bash
128- run : .github/scripts/test-adot-javaagent-image.sh "${{ env.TEST_TAG }}" "${{ github.event.inputs.version }}"
130+ run : .github/scripts/test-adot-javaagent-image.sh "${{ env.TEST_TAG }}" "${{ env.VERSION }}"
129131
130132 - name : Build and push image
131133 uses : docker/build-push-action@v5
132134 with :
133135 push : true
134- build-args : " ADOT_JAVA_VERSION=${{ github.event.inputs.version }}"
136+ build-args : " ADOT_JAVA_VERSION=${{ env.VERSION }}"
135137 context : .
136138 platforms : linux/amd64,linux/arm64
137139 tags : |
138- public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v${{ github.event.inputs.version }}
140+ public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v${{ env.VERSION }}
139141
140142 - name : Build and Publish release with Gradle
141143 uses : gradle/gradle-build-action@v3
142144 with :
143- arguments : build final closeAndReleaseSonatypeStagingRepository -Prelease.version=${{ github.event.inputs.version }} --stacktrace
145+ arguments : build final closeAndReleaseSonatypeStagingRepository -Prelease.version=${{ env.VERSION }} --stacktrace
144146 env :
145147 PUBLISH_TOKEN_USERNAME : ${{ secrets.PUBLISH_TOKEN_USERNAME }}
146148 PUBLISH_TOKEN_PASSWORD : ${{ secrets.PUBLISH_TOKEN_PASSWORD }}
@@ -152,9 +154,9 @@ jobs:
152154 env :
153155 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
154156 run : |
155- cp "otelagent/build/libs/aws-opentelemetry-agent-${{ github.event.inputs.version }}.jar" aws-opentelemetry-agent.jar
157+ cp "otelagent/build/libs/aws-opentelemetry-agent-${{ env.VERSION }}.jar" aws-opentelemetry-agent.jar
156158 gh release create --target "$GITHUB_REF_NAME" \
157- --title "Release v${{ github.event.inputs.version }}" \
159+ --title "Release v${{ env.VERSION }}" \
158160 --draft \
159- "v${{ github.event.inputs.version }}" \
161+ "v${{ env.VERSION }}" \
160162 aws-opentelemetry-agent.jar
0 commit comments