Skip to content

Commit

Permalink
TO-DROP: build-git-installers: trigger on push
Browse files Browse the repository at this point in the history
For ease of debugging

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Nov 5, 2023
1 parent 1bed580 commit ed00a0d
Showing 1 changed file with 3 additions and 47 deletions.
50 changes: 3 additions & 47 deletions .github/workflows/build-git-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,8 @@ name: build-git-installers

on:
push:
tags:
- 'v[0-9]*vfs*' # matches "v<number><any characters>vfs<any characters>"

jobs:
# Check prerequisites for the workflow
prereqs:
runs-on: ubuntu-latest
environment: release
outputs:
tag_name: ${{ steps.tag.outputs.name }} # The full name of the tag, e.g. v2.32.0.vfs.0.0
tag_version: ${{ steps.tag.outputs.version }} # The version number (without preceding "v"), e.g. 2.32.0.vfs.0.0
steps:
- name: Validate tag
run: |
echo "$GITHUB_REF" |
grep '^refs/tags/v2\.\(0\|[1-9][0-9]*\)\.\(0\|[1-9][0-9]*\)\.vfs\.0\.\(0\|[1-9][0-9]*\)$' || {
echo "::error::${GITHUB_REF#refs/tags/} is not of the form v2.<X>.<Y>.vfs.0.<W>" >&2
exit 1
}
- name: Determine tag to build
run: |
echo "name=${GITHUB_REF#refs/tags/}" >>$GITHUB_OUTPUT
echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
id: tag
- name: Clone git
uses: actions/checkout@v3
- name: Validate the tag identified with trigger
run: |
die () {
echo "::error::$*" >&2
exit 1
}
# `actions/checkout` only downloads the peeled tag (i.e. the commit)
git fetch origin +$GITHUB_REF:$GITHUB_REF
# Verify that the tag is annotated
test $(git cat-file -t "$GITHUB_REF") == "tag" || die "Tag ${{ steps.tag.outputs.name }} is not annotated"
# Verify tag follows rules in GIT-VERSION-GEN (i.e., matches the specified "DEF_VER" in
# GIT-VERSION-FILE) and matches tag determined from trigger
make GIT-VERSION-FILE
test "${{ steps.tag.outputs.version }}" == "$(sed -n 's/^GIT_VERSION = //p'< GIT-VERSION-FILE)" || die "GIT-VERSION-FILE tag does not match ${{ steps.tag.outputs.name }}"
# End check prerequisites for the workflow

# Build and sign Mac OSX installers & upload artifacts
create-macos-artifacts:
strategy:
Expand All @@ -55,9 +12,8 @@ jobs:
- name: arm64
runner: macos-latest-xl-arm64
runs-on: ${{ matrix.arch.runner }}
needs: prereqs
env:
VERSION: "${{ needs.prereqs.outputs.tag_version }}"
VERSION: "2.42.0.vfs.0.0-universal"
environment: release
steps:
- name: Check out repository
Expand Down Expand Up @@ -141,7 +97,7 @@ jobs:
set -ex
# Write to "version" file to force match with trigger payload version
echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version
echo "2.42.0.vfs.0.0-universal" >>git/version
# Configure universal build
cat >git/config.mak <<EOF
Expand Down Expand Up @@ -265,6 +221,6 @@ jobs:
shell: bash
run: |
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
echo ${{ needs.prereqs.outputs.tag_version }} >expect
echo 2.42.0.vfs.0.0-universal >expect
cmp expect actual || exit 1
# End validate installers

0 comments on commit ed00a0d

Please sign in to comment.