Skip to content

Commit

Permalink
ci: Correct font version information for new Cascadia releases
Browse files Browse the repository at this point in the history
[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]>
  • Loading branch information
Finii committed Sep 23, 2021
1 parent a2e9134 commit 6294cd6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,24 @@ jobs:
runs-on: ubuntu-18.04
env:
NERDFONTVERS: v2.1.0
CASCADIATAG: ${{ needs.check-for-new-cascadia.outputs.tag_name }}
CASCADIATAG_ISNOTNEW: ${{ needs.check-for-new-cascadia.outputs.tag_exists }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Decide on version
run: |
if [ "${CASCADIATAG_ISNOTNEW}" = "false" ]; then
echo New release is not tagged yet in our repo
echo It will only be tagged after successfull release in job 'Create tag'
OURVERSION=${CASCADIATAG}
else
echo Re-release uses our manual tags and/or patchlevel
OURVERSION=`git describe --always --tags`
fi
echo "OURVERSION=${OURVERSION}" >> $GITHUB_ENV
- name: Download latest version of Cascadia
run: |
CASCADIAVERS=`curl -L 'https://github.com/microsoft/cascadia-code/releases/latest' | grep CascadiaCode | sed 's!\(.*/microsoft/cascadia-code/releases/download/\([^"]*\).*\|.*span.*\)!\2!'`
Expand Down
5 changes: 4 additions & 1 deletion do_generate
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ fi
rm -f C*.ttf
fontforge -script font-patcher --careful "${3}" --custom SomeExtraSymbols.otf --no-progressbars "ttf/static/${4}" "${2}" | tee "process${1}.log"

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

0 comments on commit 6294cd6

Please sign in to comment.