Skip to content

Commit 6294cd6

Browse files
committed
ci: Correct font version information for new Cascadia releases
[why] When the CI is triggered (via cron) for a new Cascadia release we tag our repository only after successful Delugia generation. But we use the tag to determine which version is to be written into the font files, that we create. This means the version information in the font files is correct for manually run release jobs, but not on an cron-automated one. [how] First impulse was to just move the tagging up to happen before we create the new fonts - in fact before we fetch our repo? But maybe we want to tag our repo only if we could successfully release something. To achieve this we use the repo's tag only if there was already a release with the latest Cascadia version. If the latest Cascadia version has never been release by us (as Delugia) we directly use the new version number as our version. If we succeed in creating the fonts our repo will get the tag anyhow. Fixes: #66 Signed-off-by: Fini Jastrow <[email protected]>
1 parent a2e9134 commit 6294cd6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/ci.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,24 @@ jobs:
4949
runs-on: ubuntu-18.04
5050
env:
5151
NERDFONTVERS: v2.1.0
52+
CASCADIATAG: ${{ needs.check-for-new-cascadia.outputs.tag_name }}
53+
CASCADIATAG_ISNOTNEW: ${{ needs.check-for-new-cascadia.outputs.tag_exists }}
5254

5355
steps:
5456
- uses: actions/checkout@v2
5557
with:
5658
fetch-depth: 0
59+
- name: Decide on version
60+
run: |
61+
if [ "${CASCADIATAG_ISNOTNEW}" = "false" ]; then
62+
echo New release is not tagged yet in our repo
63+
echo It will only be tagged after successfull release in job 'Create tag'
64+
OURVERSION=${CASCADIATAG}
65+
else
66+
echo Re-release uses our manual tags and/or patchlevel
67+
OURVERSION=`git describe --always --tags`
68+
fi
69+
echo "OURVERSION=${OURVERSION}" >> $GITHUB_ENV
5770
- name: Download latest version of Cascadia
5871
run: |
5972
CASCADIAVERS=`curl -L 'https://github.com/microsoft/cascadia-code/releases/latest' | grep CascadiaCode | sed 's!\(.*/microsoft/cascadia-code/releases/download/\([^"]*\).*\|.*span.*\)!\2!'`

do_generate

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ fi
2323
rm -f C*.ttf
2424
fontforge -script font-patcher --careful "${3}" --custom SomeExtraSymbols.otf --no-progressbars "ttf/static/${4}" "${2}" | tee "process${1}.log"
2525

26-
OURVERSION=`git describe --always --tags`
26+
if [ -z "${OURVERSION}" ]; then
27+
# Github CI sets this variable, but this can be useful for manual calls:
28+
OURVERSION=`git describe --always --tags`
29+
fi
2730
fontforge rename-font --input C*.ttf --output "${5}" --name "${6}" --style "${7}" --version "${OURVERSION}"

0 commit comments

Comments
 (0)