Skip to content

Commit 28b5b51

Browse files
authored
Enable building of release candidate builds (#788)
The existing build-git-installers.yml workflow did not handle building release candidate builds correctly, mainly because it hasn't been exercised with a real release candidate build. During the rc-stages of v2.51.0, various issues were uncovered: - The tag validation was looking for the wrong format. Release candidate tags look like `v2.X.Y-rcN.vfs.W.Z`, but it was checking for a tag like `v2.X.Y.vfs.W.Z.rcN`. - The GIT-VERSION-GEN script does some munging of the tag to get to the _build_ version. Specifically the `-rc` part is replaced with `.rc` and the leading `v` is dropped.. so a tag of `v2.51.0-rc0.vfs.0.0` will become `2.51.0.rc0.vfs.0.0`. The macOS installed Makefile and scripts to create the Debian package did not correctly account for this, leading to build strings that were not consistent with those for Windows builds. With these changes, we can now successfully build release candidate versions. Tags must be of the form: ```text v2.X.Y-rcN.vfs.W.Z ``` The resulting build version (output from `git --version`) looks like: ```text 2.X.Y.rcN.vfs.W.Z ``` Installer and package file names maintain the _tag_ version format, for example: - Git-2.51.0-rc0.vfs.0.0-{64-bit,arm64}.exe - PortableGit-2.51.0-rc0.vfs.0.0-{64-bit,arm64}.7z.exe - git-2.51.0-rc0.vfs.0.0-universal.{pkg,dmg} - microsoft-git_2.51.0-rc0.vfs.0.0.deb See an example successful build here: https://github.com/microsoft/git/actions/runs/16830521090 VFS for Git recently learned to correctly parse these release candidate version strings here: microsoft/VFSForGit#1854
2 parents 999f50c + 5ef482b commit 28b5b51

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/macos-installer/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GIT_PREFIX := $(PREFIX)/git
2121
# Replace -rc with .rc in the version string
2222
# This is to ensure compatibility with the format as generated by GIT-VERSION-GEN
2323
ORIGINAL_VERSION := $(VERSION)
24-
VERSION := $(shell echo $(ORIGINAL_VERSION) | sed 's/-rc/.rc/g')
24+
VERSION := $(subst -rc,.rc,$(VERSION))
2525

2626
BUILD_DIR := $(GITHUB_WORKSPACE)/payload
2727
DESTDIR := $(PWD)/stage/git-$(ARCH_UNIV)-$(VERSION)
@@ -159,6 +159,6 @@ endif
159159
ifdef APPLE_KEYCHAIN_PROFILE
160160
notarize:
161161
@$(CURDIR)/../scripts/notarize.sh \
162-
--package="disk-image/git-$(VERSION)-$(ARCH_UNIV).pkg" \
162+
--package="disk-image/git-$(ORIGINAL_VERSION)-$(ARCH_UNIV).pkg" \
163163
--keychain-profile="$(APPLE_KEYCHAIN_PROFILE)"
164164
endif

.github/workflows/build-git-installers.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ jobs:
479479
480480
# Convert -rc to .rc to match GIT-VERSION-FILE behavior
481481
BUILD_VERSION=$(echo "${VERSION}" | sed 's/-rc/.rc/g')
482+
echo "$BUILD_VERSION" >git/version
482483
483484
# Configure universal build
484485
cat >git/config.mak <<EOF
@@ -601,6 +602,10 @@ jobs:
601602
}
602603
603604
VERSION="${{ needs.prereqs.outputs.tag_version }}"
605+
606+
# Convert -rc to .rc to match GIT-VERSION-FILE behavior
607+
BUILD_VERSION=$(echo "${VERSION}" | sed 's/-rc/.rc/g')
608+
echo "$BUILD_VERSION" >git/version
604609
make -C git GIT-VERSION-FILE
605610
606611
ARCH="$(dpkg-architecture -q DEB_HOST_ARCH)"

0 commit comments

Comments
 (0)