@@ -30,7 +30,39 @@ concurrency:
30
30
cancel-in-progress : true
31
31
32
32
jobs :
33
-
33
+ check_branch :
34
+ name : Check branch existence
35
+ runs-on : ubuntu-22.04
36
+ outputs :
37
+ columnar_locator : ${{ steps.set_locator.outputs.columnar_locator }}
38
+ steps :
39
+ - name : Check if branch exists in manticoresoftware/manticoresearch
40
+ id : check_branch
41
+ if : github.ref_name != 'master'
42
+ run : |
43
+ # Extract the actual branch name for pull requests
44
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
45
+ BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
46
+ else
47
+ BRANCH_NAME="${{ github.ref_name }}"
48
+ fi
49
+
50
+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/manticoresoftware/columnar/branches/$BRANCH_NAME)
51
+ if [ "$HTTP_STATUS" -eq "200" ]; then
52
+ echo "branch_exists=true" >> $GITHUB_OUTPUT
53
+ echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
54
+ else
55
+ echo "branch_exists=false" >> $GITHUB_OUTPUT
56
+ echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
57
+ fi
58
+ - name : Set Columnar Locator
59
+ id : set_locator
60
+ run : |
61
+ if [[ "${{ github.ref_name }}" != "master" && "${{ steps.check_branch.outputs.branch_exists }}" == "true" ]]; then
62
+ echo "columnar_locator=GIT_REPOSITORY https://github.com/manticoresoftware/columnar.git GIT_TAG ${{ steps.check_branch.outputs.branch_name }}" >> $GITHUB_OUTPUT
63
+ else
64
+ echo "columnar_locator=" >> $GITHUB_OUTPUT
65
+ fi
34
66
pack :
35
67
name : OK to pack?
36
68
runs-on : ubuntu-22.04
@@ -112,14 +144,15 @@ jobs:
112
144
pack_debian_ubuntu :
113
145
name : Debian/Ubuntu packages
114
146
uses : ./.github/workflows/build_template.yml
115
- needs : pack
147
+ needs : [ pack, check_branch]
116
148
if : needs.pack.outputs.should_continue == 'true'
117
149
strategy :
118
150
fail-fast : false
119
151
matrix :
120
152
DISTR : [bionic, focal, jammy, buster, bullseye, bookworm]
121
153
arch : [x86_64, aarch64]
122
154
with :
155
+ COLUMNAR_LOCATOR : ${{ needs.check_branch.outputs.columnar_locator }}
123
156
DISTR : ${{ matrix.DISTR }}
124
157
arch : ${{ matrix.arch }}
125
158
cmake_command : |
@@ -136,14 +169,15 @@ jobs:
136
169
pack_rhel :
137
170
name : RHEL packages
138
171
uses : ./.github/workflows/build_template.yml
139
- needs : pack
172
+ needs : [ pack, check_branch]
140
173
if : needs.pack.outputs.should_continue == 'true'
141
174
strategy :
142
175
fail-fast : false
143
176
matrix :
144
177
DISTR : [rhel7, rhel8, rhel9]
145
178
arch : [x86_64, aarch64]
146
179
with :
180
+ COLUMNAR_LOCATOR : ${{ needs.check_branch.outputs.columnar_locator }}
147
181
DISTR : ${{ matrix.DISTR }}
148
182
arch : ${{ matrix.arch }}
149
183
boost_url_key : boost_rhel_feb17
@@ -163,14 +197,15 @@ jobs:
163
197
pack_macos :
164
198
name : MacOS packages
165
199
uses : ./.github/workflows/build_template.yml
166
- needs : pack
200
+ needs : [ pack, check_branch]
167
201
if : needs.pack.outputs.should_continue == 'true'
168
202
strategy :
169
203
fail-fast : false
170
204
matrix :
171
205
DISTR : [macos]
172
206
arch : [x86_64, arm64]
173
207
with :
208
+ COLUMNAR_LOCATOR : ${{ needs.check_branch.outputs.columnar_locator }}
174
209
DISTR : ${{ matrix.DISTR }}
175
210
arch : ${{ matrix.arch }}
176
211
HOMEBREW_PREFIX : /opt/homebrew
@@ -188,9 +223,10 @@ jobs:
188
223
pack_windows :
189
224
name : Windows x64 package
190
225
uses : ./.github/workflows/build_template.yml
191
- needs : pack
226
+ needs : [ pack, check_branch]
192
227
if : needs.pack.outputs.should_continue == 'true'
193
228
with :
229
+ COLUMNAR_LOCATOR : ${{ needs.check_branch.outputs.columnar_locator }}
194
230
DISTR : windows
195
231
arch : x64
196
232
sysroot_url_key : roots_mysql83_jan17
0 commit comments