Skip to content

Commit a4446a3

Browse files
committed
chore: version is fetched from previous job
1 parent d31fa7f commit a4446a3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/ecr-release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
full_image_arm64: ${{ steps.build-publish.outputs.full_image_arm64 }}
2323
full_image_x86_64: ${{ steps.build-publish.outputs.full_image_x86_64 }}
2424
ecr_registry_repository: ${{ steps.build-publish.outputs.ecr_registry_repository }}
25+
version: ${{ steps.version.outputs.VERSION }}
2526
strategy:
2627
matrix:
2728
include:
@@ -56,9 +57,6 @@ jobs:
5657
VERSION=$(python -c "from aws_durable_execution_sdk_python_testing import __version__; print(__version__)")
5758
echo "VERSION=$VERSION"
5859
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
59-
- name: Print Version
60-
id: version-print
61-
run: echo ${{ steps.version.outputs.VERSION }}
6260
- name: Configure AWS Credentials
6361
uses: aws-actions/configure-aws-credentials@v4
6462
with:
@@ -75,8 +73,8 @@ jobs:
7573
env:
7674
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
7775
ECR_REPOSITORY: ${{ env.ecr_repository_name }}
78-
IMAGE_TAG: "${{ env.image_tag }}${{ steps.version.outputs.VERSION }}"
79-
PER_ARCH_IMAGE_TAG: "${{ matrix.arch }}${{ steps.version.outputs.VERSION }}"
76+
IMAGE_TAG: "${{ env.image_tag }}v${{ steps.version.outputs.VERSION }}"
77+
PER_ARCH_IMAGE_TAG: "${{ matrix.arch }}v${{ steps.version.outputs.VERSION }}"
8078
run: |
8179
if [ "${{ matrix.arch }}" = "x86_64" ]; then
8280
docker build --platform linux/amd64 --provenance false "${{ env.docker_build_dir }}" -f "${{ env.path_to_dockerfile }}" -t "$ECR_REGISTRY/$ECR_REPOSITORY:$PER_ARCH_IMAGE_TAG"
@@ -93,16 +91,18 @@ jobs:
9391
runs-on: ubuntu-latest
9492
needs: [build-and-upload-image-to-ecr]
9593
steps:
96-
- name: Grab image and registry/repository name from previous steps
94+
- name: Grab image, registry/repository name, version from previous steps
9795
id: ecr_names
9896
env:
9997
ECR_REGISTRY_REPOSITORY: ${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}
10098
FULL_IMAGE_ARM64: ${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}
10199
FULL_IMAGE_X86_64: ${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}
100+
VERSION: ${{ needs.build-and-upload-image-to-ecr.outputs.version }}
102101
run: |
103102
echo "full_image_arm64=$FULL_IMAGE_ARM64"
104103
echo "ecr_registry_repository=$ECR_REGISTRY_REPOSITORY"
105104
echo "full_image_x86_64=$FULL_IMAGE_X86_64"
105+
echo "version=$VERSION"
106106
- name: Configure AWS Credentials
107107
uses: aws-actions/configure-aws-credentials@v4
108108
with:
@@ -116,27 +116,27 @@ jobs:
116116
- name: Create ECR manifest with explicit tag
117117
id: create-ecr-manifest-explicit
118118
run: |
119-
docker manifest create "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ steps.version.outputs.VERSION }}" \
119+
docker manifest create "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ needs.build-and-upload-image-to-ecr.outputs.version }}" \
120120
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}" \
121121
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}"
122122
- name: Annotate ECR manifest with explicit arm64 tag
123123
id: annotate-ecr-manifest-explicit-arm64
124124
run: |
125-
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ steps.version.outputs.VERSION }}" \
125+
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ needs.build-and-upload-image-to-ecr.outputs.version }}" \
126126
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_arm64 }}" \
127127
--arch arm64 \
128128
--os linux
129129
- name: Annotate ECR manifest with explicit amd64 tag
130130
id: annotate-ecr-manifest-explicit-amd64
131131
run: |
132-
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ steps.version.outputs.VERSION }}" \
132+
docker manifest annotate "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ needs.build-and-upload-image-to-ecr.outputs.version }}" \
133133
"${{ needs.build-and-upload-image-to-ecr.outputs.full_image_x86_64 }}" \
134134
--arch amd64 \
135135
--os linux
136136
- name: Push ECR manifest with explicit version
137137
id: push-ecr-manifest-explicit
138138
run: |
139-
docker manifest push "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ steps.version.outputs.VERSION }}"
139+
docker manifest push "${{ needs.build-and-upload-image-to-ecr.outputs.ecr_registry_repository }}:${{ needs.build-and-upload-image-to-ecr.outputs.version }}"
140140
- name: Create ECR manifest with latest tag
141141
id: create-ecr-manifest-latest
142142
run: |

0 commit comments

Comments
 (0)