3131 last-release-sha : ${{ steps.get-release-info.outputs.last-release-sha }}
3232 current-master-sha : ${{ steps.get-release-info.outputs.current-master-sha }}
3333 commits-since-release : ${{ steps.get-release-info.outputs.commits-since-release }}
34- express-version : ${{ steps.compute-express-git-tag.outputs.version }}
35- express-git-tag : ${{ steps.compute-express-git-tag.outputs.git-tag }}
36- express-git-sha : ${{ steps.compute-express-git-sha.outputs.git-sha }}
37- express-docker-exists : ${{ steps.check-docker-image.outputs.express-docker-exists }}
3834 steps :
3935 - name : Checkout repository
4036 uses : actions/checkout@v6
@@ -113,95 +109,6 @@ jobs:
113109
114110 echo "" >> "$GITHUB_STEP_SUMMARY"
115111
116- - name : Checkout rel/latest branch
117- if : inputs.dry-run == false
118- uses : actions/checkout@v6
119- with :
120- ref : rel/latest
121-
122- - name : Compute express target version and tag
123- if : inputs.dry-run == false
124- id : compute-express-git-tag
125- run : |
126- VERSION=$(jq -r '.version' ./modules/express/package.json)
127- TAG="@bitgo/express@$VERSION"
128- echo "Current latest express version: $VERSION"
129- echo "Expected latest express git tag: $TAG"
130- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
131- echo "git-tag=$TAG" >> "$GITHUB_OUTPUT"
132-
133- - name : Checkout express target git tag
134- if : inputs.dry-run == false
135- uses : actions/checkout@v6
136- with :
137- ref : ${{ steps.compute-express-git-tag.outputs.git-tag }}
138- fetch-depth : 2
139-
140- - name : Parse express release information
141- if : inputs.dry-run == false
142- id : compute-express-git-sha
143- run : |
144- GIT_SHA=$(git rev-parse HEAD)
145- echo "Git SHA: $GIT_SHA"
146- echo "git-sha=$GIT_SHA" >> "$GITHUB_OUTPUT"
147-
148- - name : Sanity Check Express Git Tag
149- if : inputs.dry-run == false
150- run : |
151- # Since git tags can be moved, we need to ensure the tag we're releasing
152- # actually corresponds to a version bump in package.json
153- CURRENT_VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
154- PREVIOUS_VERSION=$(git show HEAD~1:./modules/express/package.json | jq -r '.version')
155-
156- echo "Current version: $CURRENT_VERSION"
157- echo "Previous version: $PREVIOUS_VERSION"
158-
159- if [ "$CURRENT_VERSION" == "$PREVIOUS_VERSION" ]; then
160- echo "::error::Express version bump does not line up with git tag location."
161- echo "::error::This suggests the git tag may have been moved."
162- exit 1
163- fi
164-
165- echo "✅ Express version bump lines up with git tag"
166-
167- - name : Check if Docker image already exists in Docker Hub
168- if : inputs.dry-run == false
169- id : check-docker-image
170- run : |
171- VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
172- if curl -s -f "https://hub.docker.com/v2/repositories/bitgo/express/tags/$VERSION" > /dev/null; then
173- echo "⚠️ Docker image bitgo/express:$VERSION already exists in Docker Hub — Docker publish will be skipped"
174- echo "express-docker-exists=true" >> "$GITHUB_OUTPUT"
175- else
176- echo "✅ Docker image bitgo/express:$VERSION does not exist in Docker Hub"
177- echo "express-docker-exists=false" >> "$GITHUB_OUTPUT"
178- fi
179-
180- - name : Summarise Docker image status
181- if : inputs.dry-run == false
182- run : |
183- if [ "${{ steps.check-docker-image.outputs.express-docker-exists }}" == "true" ]; then
184- echo "### ⚠️ Docker publish skipped" >> "$GITHUB_STEP_SUMMARY"
185- echo "Image \`bitgo/express:${{ steps.compute-express-git-tag.outputs.version }}\` already exists in Docker Hub." >> "$GITHUB_STEP_SUMMARY"
186- echo "The npm release will proceed normally." >> "$GITHUB_STEP_SUMMARY"
187- fi
188-
189- - name : Update Express GitHub summary
190- if : inputs.dry-run == false
191- run : |
192- {
193- echo "## BitGo Express Release Information"
194- echo ""
195- echo "Express Version: ${{ steps.compute-express-git-tag.outputs.version }}"
196- echo "Git Tag: ${{ steps.compute-express-git-tag.outputs.git-tag }}"
197- echo "Commit SHA: ${{ steps.compute-express-git-sha.outputs.git-sha }}"
198- echo ""
199- echo "### Docker Images to be deployed:"
200- echo "- \`bitgo/express:latest\`"
201- echo "- \`bitgo/express:${{ steps.compute-express-git-tag.outputs.version }}\`"
202- echo ""
203- } >> "$GITHUB_STEP_SUMMARY"
204-
205112 release-bitgojs :
206113 name : Release BitGoJS
207114 needs :
@@ -295,20 +202,112 @@ jobs:
295202 --title "v${{ steps.extract-version.outputs.new-version }}" \
296203 --notes-file "${{ steps.version-bump-summary.outputs.text-file }}"
297204
205+ get-express-release-context :
206+ name : Get Express release context
207+ if : inputs.dry-run == false
208+ needs :
209+ - release-bitgojs
210+ runs-on : ${{ vars.BASE_RUNNER_TYPE || 'ubuntu-latest' }}
211+ timeout-minutes : 10
212+ outputs :
213+ version : ${{ steps.compute-express-git-tag.outputs.version }}
214+ git-tag : ${{ steps.compute-express-git-tag.outputs.git-tag }}
215+ git-sha : ${{ steps.compute-express-git-sha.outputs.git-sha }}
216+ docker-exists : ${{ steps.check-docker-image.outputs.docker-exists }}
217+ steps :
218+ - name : Checkout rel/latest branch
219+ uses : actions/checkout@v6
220+ with :
221+ ref : rel/latest
222+ fetch-depth : 0
223+ fetch-tags : true
224+
225+ - name : Compute express target version and tag
226+ id : compute-express-git-tag
227+ run : |
228+ VERSION=$(jq -r '.version' ./modules/express/package.json)
229+ TAG="@bitgo/express@$VERSION"
230+ echo "Current latest express version: $VERSION"
231+ echo "Expected latest express git tag: $TAG"
232+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
233+ echo "git-tag=$TAG" >> "$GITHUB_OUTPUT"
234+
235+ - name : Checkout express target git tag
236+ uses : actions/checkout@v6
237+ with :
238+ ref : ${{ steps.compute-express-git-tag.outputs.git-tag }}
239+ fetch-depth : 2
240+
241+ - name : Parse express git SHA
242+ id : compute-express-git-sha
243+ run : |
244+ GIT_SHA=$(git rev-parse HEAD)
245+ echo "Git SHA: $GIT_SHA"
246+ echo "git-sha=$GIT_SHA" >> "$GITHUB_OUTPUT"
247+
248+ - name : Sanity Check Express Git Tag
249+ run : |
250+ CURRENT_VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
251+ PREVIOUS_VERSION=$(git show HEAD~1:./modules/express/package.json | jq -r '.version')
252+
253+ echo "Current version: $CURRENT_VERSION"
254+ echo "Previous version: $PREVIOUS_VERSION"
255+
256+ if [ "$CURRENT_VERSION" == "$PREVIOUS_VERSION" ]; then
257+ echo "::error::Express version bump does not line up with git tag location."
258+ echo "::error::This suggests the git tag may have been moved."
259+ exit 1
260+ fi
261+
262+ echo "✅ Express version bump lines up with git tag"
263+
264+ - name : Check if Docker image already exists in Docker Hub
265+ id : check-docker-image
266+ run : |
267+ VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
268+ if curl -s -f "https://hub.docker.com/v2/repositories/bitgo/express/tags/$VERSION" > /dev/null; then
269+ echo "⚠️ Docker image bitgo/express:$VERSION already exists — skipping publish"
270+ echo "docker-exists=true" >> "$GITHUB_OUTPUT"
271+ else
272+ echo "✅ Docker image bitgo/express:$VERSION does not exist — will publish"
273+ echo "docker-exists=false" >> "$GITHUB_OUTPUT"
274+ fi
275+
276+ - name : Update Express GitHub summary
277+ run : |
278+ if [ "${{ steps.check-docker-image.outputs.docker-exists }}" == "true" ]; then
279+ {
280+ echo "### ⚠️ Docker publish skipped"
281+ echo "Image \`bitgo/express:${{ steps.compute-express-git-tag.outputs.version }}\` already exists in Docker Hub."
282+ } >> "$GITHUB_STEP_SUMMARY"
283+ else
284+ {
285+ echo "## BitGo Express Release Information"
286+ echo ""
287+ echo "Express Version: ${{ steps.compute-express-git-tag.outputs.version }}"
288+ echo "Git Tag: ${{ steps.compute-express-git-tag.outputs.git-tag }}"
289+ echo "Commit SHA: ${{ steps.compute-express-git-sha.outputs.git-sha }}"
290+ echo ""
291+ echo "### Docker Images to be deployed:"
292+ echo "- \`bitgo/express:latest\`"
293+ echo "- \`bitgo/express:${{ steps.compute-express-git-tag.outputs.version }}\`"
294+ echo ""
295+ } >> "$GITHUB_STEP_SUMMARY"
296+ fi
297+
298298 publish-express-to-docker-hub :
299299 name : Publish Express To Docker Hub
300- if : inputs.dry-run == false && needs.get-release-context.outputs.express- docker-exists != 'true'
300+ if : needs.get-express- release-context.outputs.docker-exists != 'true'
301301 needs :
302- - get-release-context
303- - release-bitgojs
302+ - get-express-release-context
304303 runs-on : ${{ vars.BASE_RUNNER_TYPE || 'ubuntu-latest' }}
305304 timeout-minutes : 40
306305 environment : bitgo-express
307306 steps :
308307 - name : Checkout BitGoJS repository
309308 uses : actions/checkout@v6
310309 with :
311- ref : ${{ needs.get-release-context.outputs.express- git-sha }}
310+ ref : ${{ needs.get-express- release-context.outputs.git-sha }}
312311
313312 - name : Set up Docker Buildx
314313 uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
@@ -334,8 +333,8 @@ jobs:
334333 push : true
335334 tags : |
336335 bitgo/express:latest
337- bitgo/express:${{ needs.get-release-context.outputs.express- version }}
336+ bitgo/express:${{ needs.get-express- release-context.outputs.version }}
338337 build-args : |
339- VERSION=${{ needs.get-release-context.outputs.express- version }}
338+ VERSION=${{ needs.get-express- release-context.outputs.version }}
340339 BUILD_DATE=${{ steps.build-date.outputs.build-date }}
341- GIT_HASH=${{ needs.get-release-context.outputs.express- git-sha }}
340+ GIT_HASH=${{ needs.get-express- release-context.outputs.git-sha }}
0 commit comments