forked from akaffenberger/firebase-ios-sdk-xcframeworks
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 2.16 KB
/
create_release_branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Create Release Branch
on:
workflow_dispatch:
inputs:
version_override:
description: 'Version override'
required: false
type: string
schedule:
# Every day at 05:00 EST (10:00 UTC)
- cron: '0 10 * * *'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Set git credentials
run: |
/usr/bin/git config --global --add url."https://${{ secrets.AFRESHY_PAT }}:x-oauth-basic@github".insteadOf ssh://git@github
/usr/bin/git config --global --add url."https://${{ secrets.AFRESHY_PAT }}:x-oauth-basic@github".insteadOf https://github
/usr/bin/git config --global --add url."https://${{ secrets.AFRESHY_PAT }}:x-oauth-basic@github".insteadOf git@github
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.AFRESHY_PAT }}
- name: Get latest Firebase release
id: latest_firebase_release
run: |
latest_firebase_release=$(gh release view --repo $REPO --json tagName --jq '.tagName')
if [ -z "$VERSION_OVERRIDE" ]; then
echo "::set-output name=latest_firebase_release::${latest_firebase_release}"
else
echo "::set-output name=latest_firebase_release::${VERSION_OVERRIDE}"
fi
env:
REPO: firebase/firebase-ios-sdk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_OVERRIDE: ${{ inputs.version_override }}
- name: Check if branch exists
id: check_branch
run: |
git fetch origin
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
echo "::set-output name=branch_exists::true"
else
echo "::set-output name=branch_exists::false"
fi
env:
BRANCH: release/${{ steps.latest_firebase_release.outputs.latest_firebase_release }}
- name: Create release branch
if: steps.check_branch.outputs.branch_exists == 'false'
run: |
git checkout -b $BRANCH
git push origin $BRANCH
env:
BRANCH: release/${{ steps.latest_firebase_release.outputs.latest_firebase_release }}