File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,13 @@ name: Build Release
2
2
3
3
on :
4
4
workflow_dispatch :
5
- create :
6
5
push :
7
6
branches :
8
7
- ' release/*'
9
8
10
9
jobs :
11
10
build :
12
11
runs-on : macos-latest
13
- if : ${{ (github.event.ref_type == 'branch') && startsWith(github.ref, 'refs/heads/release/') }}
14
12
steps :
15
13
- name : Checkout
16
14
uses : actions/checkout@v4
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ name: Create Release Branch
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ version_override :
7
+ description : ' Version override'
8
+ required : false
9
+ type : string
5
10
schedule :
6
11
# Every day at 05:00 EST (10:00 UTC)
7
12
- cron : ' 0 10 * * *'
@@ -25,10 +30,16 @@ jobs:
25
30
id : latest_firebase_release
26
31
run : |
27
32
latest_firebase_release=$(gh release view --repo $REPO --json tagName --jq '.tagName')
28
- echo "::set-output name=latest_firebase_release::${latest_firebase_release}"
33
+
34
+ if [ -z "$VERSION_OVERRIDE" ]; then
35
+ echo "::set-output name=latest_firebase_release::${VERSION_OVERRIDE}"
36
+ else
37
+ echo "::set-output name=latest_firebase_release::${latest_firebase_release}"
38
+ fi
29
39
env :
30
40
REPO : firebase/firebase-ios-sdk
31
41
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42
+ VERSION_OVERRIDE : ${{ inputs.version_override }}
32
43
33
44
- name : Check if branch exists
34
45
id : check_branch
Original file line number Diff line number Diff line change @@ -49,13 +49,20 @@ jobs:
49
49
echo "Getting build workflow run for branch: $branch_name"
50
50
51
51
# Get the latest workflow run ID for the branch
52
- run_id=$(gh run list --branch $branch_name --workflow "Build Release" --limit 1 --json databaseId | jq -r '.[0].databaseId')
52
+ run_id=$(gh run list --branch $branch_name --workflow "Build Release" --status success -- limit 1 --json databaseId | jq -r '.[0].databaseId')
53
53
54
54
if [ "$run_id" = "null" ]; then
55
55
echo "No build workflow run found for branch $branch_name"
56
56
else
57
57
echo "Found build workflow run ID : $run_id"
58
58
59
+ artifact_count=$(gh api repos/${{ github.repository }}/actions/runs/$run_id/artifacts | jq -r '.total_count')
60
+
61
+ if [ "$artifact_count" -eq 0 ]; then
62
+ echo "No artifacts found for workflow run $run_id"
63
+ exit 0
64
+ fi
65
+
59
66
# Download all artifacts from the workflow run
60
67
gh run download $run_id --repo ${{ github.repository }} --dir ./artifacts/
61
68
You can’t perform that action at this time.
0 commit comments