@@ -41,11 +41,26 @@ jobs:
4141 echo "Building binaries to attach to the release if any..."
4242 if "${{ inputs.images == 'cert-csi' }}"; then
4343 make build
44+ mv cert-csi cert-csi-linux-amd64
45+ echo "BIN_NAME=cert-csi-linux-amd64" >> $GITHUB_ENV
4446 fi
4547 if "${{ contains(inputs.images, 'dell-csi-replicator') || contains(inputs.images, 'dell-replication-controller') }}"; then
46- cd repctl && make build
48+ cd repctl
49+ make build
50+ mv repctl repctl-linux-amd64
51+ mv repctl-linux-amd64 ../
52+ echo "BIN_NAME=repctl-linux-amd64" >> $GITHUB_ENV
4753 fi
4854
55+ - name : Upload Binaries
56+ if : ${{ env.BIN_NAME != '' }}
57+ 58+ env :
59+ BIN_NAME : ${{ env.BIN_NAME }}
60+ with :
61+ name : ${{ env.BIN_NAME }}
62+ path : ${{ env.BIN_NAME }}
63+
4964 release-and-tag :
5065 name : Tag and Release
5166 needs : build-and-scan
6378 run : echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
6479
6580 - name : Push images to Dockerhub
81+ shell : bash
6682 run : |
6783 # Push each comma seperated images by splitting the string with ','
6884 images_list=$(echo '${{ inputs.images }}' | tr -d '[]"' | tr ',' ' ')
@@ -98,12 +114,16 @@ jobs:
98114 done
99115
100116 - name : Push images to Quay.io
117+ shell : bash
101118 run : |
102119 # Push each comma seperated images by splitting the string with ','
103120 images_list=$(echo '${{ inputs.images }}' | tr -d '[]"' | tr ',' ' ')
121+
122+ REPOSITORY="dell/container-storage-modules"
123+
104124 for image in $images_list; do
105125
106- latest_version=$(curl -s https://quay.io/api/v1/repository/dell/container-storage-modules /$image/tag/?limit=100 | jq -r '.tags[].name' | sort -V | tail -n 1)
126+ latest_version=$(curl -s https://quay.io/api/v1/repository/$REPOSITORY /$image/tag/?limit=100 | jq -r '.tags[].name' | sort -V | tail -n 1)
107127 echo "Current latest version of $image:$latest_version"
108128
109129 IFS='.' read -r -a version_parts <<< "$latest_version"
@@ -123,23 +143,23 @@ jobs:
123143 version_parts[2]=$(expr ${version_parts[2]} + 1)
124144 new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}"
125145 fi
126- repository='dell/container-storage-modules'
146+
127147 # Get manifest digest
128- SHA=$(curl -s --location --request GET 'https://quay.io/api/v1/repository/$repository/$image/tag?specificTag=nightly' --header 'Content-Type: application/json' --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' | jq -r '.tags[0].manifest_digest')
129-
130- echo "Pushing image: $image:$new_version"
148+ SHA=$(curl -s --location --request GET https://quay.io/api/v1/repository/$REPOSITORY/$image/tag?specificTag=nightly --header 'Content-Type: application/json' --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' | jq -r '.tags[0].manifest_digest')
149+ echo "Pushing image: $image:$new_version"
131150
132- # Create version and latest tags
133- curl -s --location --request PUT 'https://quay.io/api/v1/repository/$repository/$image/tag/$new_version' \
134- --header 'Content-Type: application/json' \
135- --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \
136- --data-raw '{
137- "manifest_digest": "$SHA"
138- }'
139- curl -s --location --request PUT 'https://quay.io/api/v1/repository/$repository/$image/tag/latest' \
140- --header 'Content-Type: application/json' \
141- --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \
142- --data-raw '{
143- "manifest_digest": "$SHA"
144- }'
151+ # Create version and latest tags
152+ curl --location --request PUT https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/$new_version \
153+ --header 'Content-Type: application/json' \
154+ --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \
155+ --data-raw '{
156+ "manifest_digest": "'"$SHA"'"
157+ }'
158+
159+ curl --location --request PUT https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/latest \
160+ --header 'Content-Type: application/json' \
161+ --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \
162+ --data-raw '{
163+ "manifest_digest": "'"$SHA"'"
164+ }'
145165 done
0 commit comments