Skip to content

Commit 638108d

Browse files
committed
git-artifacts: support building MinGit backports from tags
When building MinGit backports from tags (identified by specifying "mingit" or "mingit mingit-busybox" as `artifacts` value), we need to use a different default release branch name, e.g. `mingit-2.43.x-releases`. While at it, also adjust the check run name to reflect that this is not a regular Git for Windows build but a MinGit one. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 4934aca commit 638108d

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ env:
3737
TAG_GIT_WORKFLOW_RUN_ID: "${{github.event.inputs.tag_git_workflow_run_id}}"
3838
EXISTING_GIT_TAG: "${{github.event.inputs.existing_git_tag}}"
3939
RELEASE_BRANCH: "${{github.event.inputs.release_branch}}"
40+
GIT_OR_MINGIT: "Git"
4041

4142
defaults:
4243
run:
@@ -68,11 +69,23 @@ jobs:
6869
test -z "$TAG_GIT_WORKFLOW_RUN_ID" ||
6970
die 'existing_git_tag cannot be used with tag_git_workflow_run_id!'
7071
72+
if test mingit = "$ARTIFACTS_TO_BUILD" || test "mingit mingit-busybox" = "$ARTIFACTS_TO_BUILD"
73+
then
74+
GIT_OR_MINGIT=MinGit
75+
echo "GIT_OR_MINGIT=MinGit" >>$GITHUB_ENV
76+
fi
77+
7178
if test -n "$RELEASE_BRANCH"
7279
then
73-
RELEASE_BRANCH="${EXISTING_GIT_TAG%%.windows.*}" &&
74-
RELEASE_BRANCH=git-"${RELEASE_BRANCH#v}" &&
75-
test git- != "$RELEASE_BRANCH" ||
80+
if test MinGit = "$GIT_OR_MINGIT"
81+
then
82+
RELEASE_BRANCH=mingit-"$(expr "$EXISTING_GIT_TAG" : 'v\?\([0-9]\+\.[0-9]\+\)\.\{0,1\}[0-9]*\(\.windows\.[0-9]*\)\?$')".x-releases &&
83+
test mingit-.x-releases != "$RELEASE_BRANCH"
84+
else
85+
RELEASE_BRANCH="${EXISTING_GIT_TAG%%.windows.*}" &&
86+
RELEASE_BRANCH=git-"${RELEASE_BRANCH#v}" &&
87+
test git- != "$RELEASE_BRANCH"
88+
fi ||
7689
die "Could not determine release branch from '$EXISTING_GIT_TAG'"
7790
echo "RELEASE_BRANCH=$RELEASE_BRANCH" >>$GITHUB_ENV
7891
fi
@@ -134,8 +147,8 @@ jobs:
134147
repo: ${{ env.REPO }}
135148
rev: ${{ env.GIT_REV }}
136149
check-run-name: "git-artifacts-${{ env.ARCHITECTURE }}"
137-
title: "Build Git ${{ env.GIT_VERSION }} artifacts"
138-
summary: "Build Git ${{ env.GIT_VERSION }} artifacts from commit ${{ env.GIT_REV }}${{ env.TAG_GIT_WORKFLOW_RUN_ID && format(' (tag-git run #{0})', env.TAG_GIT_WORKFLOW_RUN_ID) || '' }}"
150+
title: "Build ${{ env.GIT_OR_MINGIT }} ${{ env.GIT_VERSION }} artifacts"
151+
summary: "Build ${{ env.GIT_OR_MINGIT }} ${{ env.GIT_VERSION }} artifacts from commit ${{ env.GIT_REV }}${{ env.TAG_GIT_WORKFLOW_RUN_ID && format(' (tag-git run #{0})', env.TAG_GIT_WORKFLOW_RUN_ID) || '' }}"
139152
text: "For details, see [this run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id}})."
140153
details-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id}}"
141154
- name: Re-publish bundle-artifacts so the next job can easily use it

0 commit comments

Comments
 (0)