Skip to content

Commit 81895dc

Browse files
author
Ondrej Machala
committed
fix: wait for Build Binaries workflow before Docker build
Docker workflow now uses workflow_run trigger to wait for Build Binaries to complete before attempting to download the binary. This fixes the race condition where Docker build would fail because binaries weren't uploaded yet.
1 parent 80f922e commit 81895dc

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/docker.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Docker
22

33
on:
4-
release:
5-
types: [published]
4+
# Trigger after Build Binaries workflow completes (not on release directly)
5+
# This ensures binaries are uploaded before we try to download them
6+
workflow_run:
7+
workflows: ['Build Binaries']
8+
types: [completed]
69
workflow_dispatch:
710
inputs:
811
version:
@@ -12,20 +15,24 @@ on:
1215
jobs:
1316
docker:
1417
runs-on: ubuntu-latest
18+
# Only run if Build Binaries succeeded (or if manually triggered)
19+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
1520
steps:
1621
- uses: actions/checkout@v4
1722

1823
- name: Determine version
1924
id: version
2025
run: |
21-
if [ "${{ github.event_name }}" = "release" ]; then
22-
# Extract version from tag ([email protected] -> 0.8.0)
23-
VERSION="${{ github.event.release.tag_name }}"
26+
if [ "${{ github.event_name }}" = "workflow_run" ]; then
27+
# Get the latest release version
28+
VERSION=$(gh release view --json tagName -q '.tagName')
2429
VERSION="${VERSION#heroshot@}"
2530
else
2631
VERSION="${{ github.event.inputs.version }}"
2732
fi
2833
echo "version=$VERSION" >> $GITHUB_OUTPUT
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2936

3037
- name: Download heroshot binary from release
3138
run: |

0 commit comments

Comments
 (0)