Add some scripts to be used in GH Actions #528
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea here is that there are certain (complex) steps we need to perform as part of GitHub actions in the googlefonts-project-template repo. If those steps lived in the googlefonts-project-template repo itself, we would lose control over the ability to maintain them, as they would be forked into all of the downstream repos. But if the code to perform those steps is part of gftools, then we can roll out updates just by doing another gftools release. The GitHub actions don't use the venv (because that's used for font building and is frozen, so that won't get updates either); instead they explicitly grab the latest version of gftools and run the actions outside the venv. So they're always up to date as of when the Action is run.
The scripts I've added are:
checkgooglefonts
: Very simple - reads theconfig.yaml
and sets a GH Actions workflow context ifconfig["googleFonts"]
is true (i.e. if this font is intended to be onboarded to GF.)checkversionbump
: This one is not so simple. It checks whether the version of the font in the font source files is greater than the last tagged release; i.e. if the font has been bumped since the last release was created, and therefore if a new release is needed. It sets GH Actions workflow contexts to indicate if a new release is needed and if so what version number / tag it should be.notobuilder
: This is a subclass of gftools builder which I'm planning to use as part of the Noto build process. It's not plugged into anything yet; that's the next piece of the puzzle but I wanted to get the onboarding stuff working first.qa2issue
: This takes a fontbakery report and a version number. It then looks on Github for an issue related to the version; if there is not one, it creates one, and if there is one, it adds the report as a comment. This ensures that each font version gets one single QA issue, so that the user does not get spammed with new issues for each commit.updateupstream
: This updates an upstream.yaml from a GitHub release, generating one if there isn't one in the repo already.Note that this introduces a new schema key to
config.yaml