11
11
skipIntegrationTests :
12
12
description : ' skip integration tests?'
13
13
default : 0
14
+ working_branch :
15
+ description : ' If already a working in progress release branch'
16
+ default : None
14
17
15
18
jobs :
16
19
package_sdks :
28
31
29
32
with :
30
33
fetch-depth : 0
31
- ref : ${{ github.event.inputs.baseBranch }}
34
+ ref : ${{ github.event.inputs.working_branch }}
32
35
33
36
- name : Get token for firebase-workflow-trigger
34
37
uses : tibdex/github-app-token@v1
@@ -48,18 +51,26 @@ jobs:
48
51
pip install -r scripts/gha/requirements.txt
49
52
50
53
- name : Name new branch
51
- if : github.event.inputs.package_version_number != 0
54
+ if : github.event.inputs.working_branch == 'None'
52
55
run : |
53
56
date_str=$(date "+%Y%m%d-%H%M%S")
54
57
echo "NEW_BRANCH=${{env.branchPrefix}}${{github.event.inputs.package_version_number}}-${date_str}" >> $GITHUB_ENV
55
58
56
59
- name : Create new branch
57
- if : github.event.inputs.package_version_number != 0
60
+ if : github.event.inputs.working_branch == 'None'
58
61
run : |
59
62
git remote update
60
63
git checkout -b "${NEW_BRANCH}"
61
64
echo "UPDATE_LOGFILE=update_log.txt" >> $GITHUB_ENV
62
65
66
+ - name : Checkout working branch
67
+ if : github.event.inputs.working_branch != 'None'
68
+ run : |
69
+ git remote update
70
+ git checkout ${{ github.event.inputs.working_branch }}
71
+ echo "UPDATE_LOGFILE=update_log.txt" >> $GITHUB_ENV
72
+ echo "NEW_BRANCH=${{ github.event.inputs.working_branch }}" >> $GITHUB_ENV
73
+
63
74
# Fetch all the zip files from previous run
64
75
- name : Fetch Desktop Artifacts
65
76
uses : dawidd6/action-download-artifact@v2
@@ -81,15 +92,36 @@ jobs:
81
92
workflow : ' android.yml'
82
93
run_id : ${{ github.event.inputs.downloadPreviousRun }}
83
94
path : built_artifect
95
+
96
+ - name : move zip files
97
+ run : |
98
+ cd built_artifect
99
+ find . -type f -name "*.zip" -exec mv {} . \;
100
+ ls -l
101
+ cd ..
84
102
85
- # - name: Update Guids Json
86
- # if: github.event.inputs.package_version_number != 0
87
- # run: |
103
+ - name : Package unitypackage
104
+ run : |
105
+ python build_package.py --zip_dir=built_artifect
88
106
89
- - name : Push branch if there are changes
107
+ - name : Commit Changes if there is any
108
+ run : |
109
+ if ! git update-index --refresh; then
110
+ git config user.email "[email protected] "
111
+ git config user.name "firebase-workflow-trigger-bot"
112
+ git config core.commentChar "%" # so we can use # in git commit messages
113
+ git commit -a -m "Update Guids ID"
114
+
115
+ # Show changes in git log
116
+ git diff
117
+ # Push branch
118
+ git push --set-upstream origin "${NEW_BRANCH}"
119
+ fi
120
+
121
+ - name : Create PR if there is None
122
+ if : github.event.inputs.working_branch == 'None'
90
123
id : push-branch
91
124
run : |
92
- cd firebase-unity-sdk
93
125
if ! git update-index --refresh; then
94
126
date_str=$(date "+%a %b %d %Y")
95
127
commit_title="Update Unity SDK dependencies - ${date_str}"
@@ -123,17 +155,6 @@ jobs:
123
155
echo "::set-output name=branch_pushed::0"
124
156
fi
125
157
126
- - name : move zip files
127
- run : |
128
- cd built_artifect
129
- find . -type f -name "*.zip" -exec mv {} . \;
130
- ls -l
131
- cd ..
132
-
133
- - name : Package unitypackage
134
- run : |
135
- python build_package.py --zip_dir=built_artifect
136
-
137
158
- name : Listing output
138
159
run : |
139
160
ls -Rl
0 commit comments