|
23 | 23 | - name: Validate tag |
24 | 24 | run: | |
25 | 25 | echo "$GITHUB_REF" | |
26 | | - grep -E '^refs/tags/v2\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.vfs\.0\.(0|[1-9][0-9]*)(\.rc[0-9])?$' || { |
27 | | - echo "::error::${GITHUB_REF#refs/tags/} is not of the form v2.<X>.<Y>.vfs.0.<W>[.rc<N>]" >&2 |
| 26 | + grep -E '^refs/tags/v2\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc[0-9]+)?\.vfs\.0\.(0|[1-9][0-9]*)$' || { |
| 27 | + echo "::error::${GITHUB_REF#refs/tags/} is not of the form v2.<X>.<Y>[-rc<N>].vfs.0.<W>" >&2 |
28 | 28 | exit 1 |
29 | 29 | } |
30 | 30 | - name: Determine tag to build |
|
49 | 49 |
|
50 | 50 | # Verify tag follows rules in GIT-VERSION-GEN (i.e., matches the specified "DEF_VER" in |
51 | 51 | # GIT-VERSION-FILE) and matches tag determined from trigger |
52 | | - make GIT-VERSION-FILE |
53 | | - test "${{ steps.tag.outputs.version }}" == "$(sed -n 's/^GIT_VERSION *= *//p'< GIT-VERSION-FILE)" || die "GIT-VERSION-FILE tag ($(cat GIT-VERSION-FILE)) does not match ${{ steps.tag.outputs.name }}" |
| 52 | + make GIT-VERSION-FILE |
| 53 | + expected_version="${{ steps.tag.outputs.version }}" |
| 54 | + # Convert -rc to .rc to match GIT-VERSION-FILE format |
| 55 | + expected_version="${expected_version//-rc/.rc}" |
| 56 | + test "$expected_version" == "$(sed -n 's/^GIT_VERSION *= *//p'< GIT-VERSION-FILE)" || die "GIT-VERSION-FILE tag ($(cat GIT-VERSION-FILE)) does not match ${{ steps.tag.outputs.name }}" |
54 | 57 | # End check prerequisites for the workflow |
55 | 58 |
|
56 | 59 | # Build Windows installers (x86_64 & aarch64; installer & portable) |
@@ -474,8 +477,11 @@ jobs: |
474 | 477 | # Trace execution, stop on error |
475 | 478 | set -ex |
476 | 479 |
|
| 480 | + # Convert -rc to .rc to match GIT-VERSION-FILE behavior |
| 481 | + BUILD_VERSION=$(echo "${VERSION}" | sed 's/-rc/.rc/g') |
| 482 | +
|
477 | 483 | # Write to "version" file to force match with trigger payload version |
478 | | - echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version |
| 484 | + echo "${BUILD_VERSION}" >>git/version |
479 | 485 |
|
480 | 486 | # Configure universal build |
481 | 487 | cat >git/config.mak <<EOF |
@@ -508,20 +514,20 @@ jobs: |
508 | 514 |
|
509 | 515 | make -C git -j$(sysctl -n hw.physicalcpu) GIT-VERSION-FILE dist dist-doc |
510 | 516 |
|
511 | | - export GIT_BUILT_FROM_COMMIT=$(gunzip -c git/git-$VERSION.tar.gz | git get-tar-commit-id) || |
| 517 | + export GIT_BUILT_FROM_COMMIT=$(gunzip -c git/git-$BUILD_VERSION.tar.gz | git get-tar-commit-id) || |
512 | 518 | die "Could not determine commit for build" |
513 | 519 |
|
514 | 520 | # Extract tarballs |
515 | 521 | mkdir payload manpages |
516 | | - tar -xvf git/git-$VERSION.tar.gz -C payload |
517 | | - tar -xvf git/git-manpages-$VERSION.tar.gz -C manpages |
| 522 | + tar -xvf git/git-$BUILD_VERSION.tar.gz -C payload |
| 523 | + tar -xvf git/git-manpages-$BUILD_VERSION.tar.gz -C manpages |
518 | 524 |
|
519 | 525 | # Lay out payload |
520 | | - cp git/config.mak payload/git-$VERSION/config.mak |
| 526 | + cp git/config.mak payload/git-$BUILD_VERSION/config.mak |
521 | 527 | make -C git/.github/macos-installer V=1 payload |
522 | 528 |
|
523 | 529 | # Codesign payload |
524 | | - cp -R stage/git-universal-$VERSION/ \ |
| 530 | + cp -R stage/git-universal-$BUILD_VERSION/ \ |
525 | 531 | git/.github/macos-installer/build-artifacts |
526 | 532 | make -C git/.github/macos-installer V=1 codesign \ |
527 | 533 | APPLE_APP_IDENTITY='${{ steps.signing-secrets.outputs.appsign-id }}' || die "Creating signed payload failed" |
@@ -597,11 +603,14 @@ jobs: |
597 | 603 | exit 1 |
598 | 604 | } |
599 | 605 |
|
600 | | - echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version |
601 | | - make -C git GIT-VERSION-FILE |
602 | | -
|
603 | 606 | VERSION="${{ needs.prereqs.outputs.tag_version }}" |
604 | 607 |
|
| 608 | + # Convert -rc to .rc to match GIT-VERSION-GEN behavior |
| 609 | + BUILD_VERSION=$(echo "$VERSION" | sed 's/-rc/.rc/g') |
| 610 | + echo "${BUILD_VERSION}" >>git/version |
| 611 | +
|
| 612 | + make -C git GIT-VERSION-FILE |
| 613 | +
|
605 | 614 | ARCH="$(dpkg-architecture -q DEB_HOST_ARCH)" |
606 | 615 | if test -z "$ARCH"; then |
607 | 616 | die "Could not determine host architecture!" |
@@ -768,7 +777,7 @@ jobs: |
768 | 777 | shell: bash |
769 | 778 | run: | |
770 | 779 | "${{ matrix.component.command }}" --version | sed 's/git version //' >actual |
771 | | - echo ${{ needs.prereqs.outputs.tag_version }} >expect |
| 780 | + echo "${{ needs.prereqs.outputs.tag_version }}" | sed 's/-rc/.rc/g' >expect |
772 | 781 | cmp expect actual || exit 1 |
773 | 782 |
|
774 | 783 | - name: Validate universal binary CPU architecture |
|
0 commit comments