Commit graph

115 commits

Author SHA1 Message Date
Fini Jastrow
52799046aa CI: Tag every created docker with 'latest', as before [skip ci]
[why]
Tagging behavior changed with inclusion of the Meta action.
Previously every docker-rebuild has been tagged 'latest', that is now
missing.

[how]
Enforce latest tag.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-28 11:24:11 +02:00
Fini Jastrow
018bedb969 CI: Enable manual docker rebuilds [skip ci]
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-28 11:10:21 +02:00
Fini Jastrow
3cc1d20b6b CI: Small changes on docker workflow
[why]
Credentials not needed (I guess).
Workflow is never run on pull-requests, so no check needed.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-28 11:02:12 +02:00
Sam McLeod
3f755e4838 feat: use standard Docker build Actions 2022-10-28 08:20:09 +11:00
Fini Jastrow
83d41b6220 CI: Fix workflow for the gh-pages (still ongoning?) [skip ci]
[why]
checkout-files checks out the last version on the push target branch,
not the version we actually pushed.

checkout clears all the workspace, so out file we want to commit is
lost.

[how]
Use commit hash from just pushed commit.

Use temporary directory outside of workspace to store the file.
Unfortunately we haved to copy back because github-pages-deploy-action
seems to take no absolute paths.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-18 20:47:29 +02:00
Fini Jastrow
65eaac85c7 CI: Fix workflow for the gh-pages
Well, ... we need to fetch the git repo, as the deploy action needs it.
Which is documented... :-}

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-18 19:00:26 +02:00
Fini Jastrow
1061a623a8 CI: Add workflow for the gh-pages [skip ci]
[why]
A lot of the stuff in the gh-pages is not yet automatized.
See bin/scripts/README.md items with "[3]".

[how]
Start at least with the fonts database file.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-18 18:39:16 +02:00
Fini Jastrow
49878a2f61 CI: Remove set-output commands [skip ci]
[why]
The set-output command will be removed, see [1].

[how]
Use output environment file instead.

[1] https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-13 16:37:20 +02:00
Fini Jastrow
5fe831289f ci: Change commit message of rebuild [skip ci]
[why]
Messages should be in the imperative form.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-12 14:02:08 +02:00
Fini Jastrow
3fd15de2a3 CI: Try to commit changes only if we optimized some svgs
[why]
When so svg files could be optimized we still try to commit the
'changes'. There are no changes - so nothing is committed (empty commits
are avoided).

But the workflow run still shows the 'commit back to repo' step,
although we know beforehand that it will not commit anything.

[how]
Technically that is no problem and the behavior is unchanged, but we can
just skip the commit step if we know there can not be anything to
commit...

It just looks nicer :-}

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-21 13:47:41 +02:00
Fini Jastrow
725344def5 CI: Fix unneeded font rebuild commits
[why]
Despite commit
  cc2b54770 generate-original-source: Remove FFTM table
we still get unneeded font rebuilds.

The reason is that the font creation time is not only encoded in FFTM but
also in HEAD.

[how]
We could simply diable timestamps also in HEAD, but that would leave us
with a strange font; strange because no one knows when it has been
created.

Instead we take the more laberous route here: Do detect changes and not
rely on the git history:
* Find out current font's creation date
* Create the font anew with that date as creation date
* If the 'real' font content is unchanged we would now have a 100%
  identical new font file; we can detect that with `git diff`
* If it is not identical, something apart from the timestamp has
  changed and we create the font again, this time with the real current
  time as timestamp and commit that file back to the repo

This only works if creation and modification time are always the same on
all font creations; we need to ensure this by always using the
SOURCE_DATE_EPOCH method, even for 'normal' font creation.

This is a bit more involved than what I would have hoped for, but there
seems to be no easy solution.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-21 10:29:15 +02:00
Fini Jastrow
73ae4a96b4 CI: Optimize original glyph svgs
[why]
Often the SVGs are rather detailed and result in a big
original-source.otf, which then again results in bigger than needed
patched fonts.

[how]
Typically people suggest using svgo to make SVGs smaller, but that just
tackles the representation of the icon, i.e. the actual svg file. That
does not help us at all. We do not need small svg files, we need simple
icons with few points and lines. svgo does not have that capability.

Instead Inkscape's 'Simplify' is used. Repeated use can destroy a glyph,
so we need a scale down margin to stop 'over-simplification'.

The values given for the margin at the moment are purely empirical, the
current glyphs survive repeated use of the new simplification script and
still look good.

The resultant original-source.otf file size is approximately similar to
the previously achieved by Ryan's manual work.

[note]
We need a newer Inkscape, thus update to Ubuntu 22.04

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-19 16:08:22 +02:00
Fini Jastrow
acafd63619 CI: Add workflow for source font generator
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-19 15:55:01 +02:00
Fini Jastrow
50657caa63 CI: Do not fetch on add-and-commit
[why]
The add-and-commit steps are so unbelievable slow.

[how]
We do not need the other tags, so we do not need a fetch before adding.
See comments on the action's homepage.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-11 16:41:12 +02:00
Fini Jastrow
134c518892 CI: Generate CSS and push to repo and gh-pages
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-09-11 16:41:12 +02:00
Fini Jastrow
51b99e0a7a CI: Disable cask creation (for now) [skip ci]
[why]
After discussion with
https://github.com/Homebrew/homebrew-cask-fonts/pull/6167#issuecomment-1229152446
I assume we would never use this in CI.

It can be helpful for new fonts, but even then they suggest using the
tools provided (i.e.`font-casker`):
https://github.com/Homebrew/homebrew-cask-fonts/blob/master/CONTRIBUTING.md#automatic-generation

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-30 10:57:44 +02:00
Fini Jastrow
6c2d3ec752 CI: Fix cask artifact upload
[why]
The casks-artifact is empty.

[how]
Supply the correct path for the upload.
For this the generator script prints the output pathname(s),
which in turn are used in the CI.

Also drop unneeded '/' from path end.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-30 10:46:51 +02:00
Fini Jastrow
75ce899201 CI: Mark release "draft" while creation
[why]
We create the release packages one by one in a lot of jobs. Whenever a
job is ready it adds its package to the release.

This means that the release starts with one archive and grows over the
next 5 (!) hours. (Noto takes about 5h to patch.)

But people will be notified and find the new *unfinished* release, which
can raise questions or problems.

[how]
Mark the release 'draft'.

Unfortunately I can not find (quickly, now) a way to un-draft the
release so this has to be done manually. Maybe it is better anyhow, so
that one can edit the release message etc.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Fini Jastrow
f4f19ea0e1 CI: Fix hopeless-docker prevention
[why]
I am sure I tested it and it worked. Well, it does not, it throws an
error message
  Unrecognized named-value: 'secrets'

[how]
Secrets can not be used in the `if`, see
https://github.com/actions/runner/issues/520

But they can be used in `env`, ... so do it there.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 19:31:48 +02:00
Fini Jastrow
1d6aa1748d CI: Prevent docker release when hopeless
[why]
On forks for example they might have a docker repo associated or not.
The release process is run in any case and will fail in that cases.

[how]
Check that at least the secret is known.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 11:34:07 +02:00
Fini Jastrow
43b5af6271 CI: Fix docker release trigger
[why]
The docker image should be rebuilt whenever a file that will end up in
the container has been changed. So this needs to be in line with the
.dockerignore file.

[how]
Add missing (new) `font-patcher` sub-scripts.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 11:30:27 +02:00
Fini Jastrow
a777d53008 CI: Use jq to process package.json
[why]
`grep` and `awk` do not know json. This might break if some format
changes or whatever.

[note]
The font matrix setup is also with `jq`.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:45:11 +02:00
Fini Jastrow
e972eb0785 CI: Prepend release tags with a "v"
[why]
Usually release tags and versions start with a "v", and we also had that
up to 2.1.0:

$ git tag -l
2.2.0-RC
FontPatcher
v0.1.0
v0.1.1
v0.1.2
v0.2.0
v0.2.1
v0.3.0
v0.3.1
v0.4.0
v0.4.1
v0.5.0
v0.5.1
v0.6.0
v0.6.1
v0.7.0
v0.8.0
v1.0.0
v1.1.0
v1.2.0
v2.0.0
v2.1.0

[how]
In the files we keep the non-"v" version numbers, but the tags on github
shall be prepended with a "v" like "v2.2.0-RC".

The variable RELEASE_TAG_VERSION is renamed to RELEASE_VERSION to make
clear that this is not the name of the tag.

Where we reference a tag, "v$RELEASE_VERSION" is used.

[note]
One of the environment variable is not needed, we can use the output directly.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:44:28 +02:00
Fini Jastrow
039f5baffe CI: Allow releases on package.json change
[why]
The release workflow is triggered on a lot occasions, but not on changes
of the package.json file. But that file contains our version number and
when we change it we should create a new release. At least is that how I
would imagine it working.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
3c78eb7f09 CI: Make commits from the action stand out more
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
967036e731 CI: Fix fontconfig and casks
[why]
The fontconfig and cask generation seems unfinished or broken.

[how]
Fix the point in time when the fontconfig is generated and commit any
changes back to the repo.

Generate the casks and store them as CI artifacts at least.
Probably they should be uploaded to the cask repo (on 'real' releases)?

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:32:26 +02:00
Fini Jastrow
bc87b361a2 CI: Prevent rolling release on normal releases
[why]
The release CI is run every time something is pushed to master. This is
useful if we are on a release candidate. The release will be updated.

But if we do a normal release and afterwards push some new commit to
master - before we update the version in the package.json to a RC - the
actual (fixed) release will also be updated.

[how]
Determine if we have a

* new normal release
* new prerelease
* updated prerelease

and run the release process itself only in that cases.

[note]
The release is checked for via API instead of an action, because the
typical action needs a complete checkout (works on the local git repo).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-26 09:31:57 +02:00
Fini Jastrow
fcdb7b04f5 CI: Advance tag after adding commits to release
[why]
When people check the repo out at a release tag they expect to get all
the files that are IN the release.
But we add the patched fonts and the version-bumped scripts only
afterwards.

[how]
Just overwrite (shift) the tag after everything is finished.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 19:47:11 +02:00
Fini Jastrow
9a33516649 CI: Add names for some steps
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
f5a9a007da CI: Simplify checkout for matrix setup
[why]
We check the whole repo out, just to set up the font matrix.
All data is thrown away afterwards. That takes needless time.

[how]
Just check out the two files we really need for the setup (the script
and the database).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
abdae7bb01 CI: Strip blanks from release tag version string
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
a57403f833 CI: Centralize release version determination
[why]
We need the release tag version in all jobs.

[how]
Instead of determining it in every job again and again (with the same
code) we set an output in the first job and reuse it everywhere.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
7b81d7c84a CI: Fix version bump
[why]
This can not work.

Issue 1:
It is unspecified in which order the font matrix jobs run, so the
version number changes somewhen.

The changed (version-bumped) files are never committed and written back,
so this would have to be done manually anyhow.

The version-bump script itself has issues because the regexes for the
change are a bit too loose and other version like strings are changes
also (like the Script Version).

Issue 2:
The script changed versions that should not be changed like the script version
in the scripts (rather than the NF release version).

In bin/scripts/generate-glyph-info-from-set.py pumping has been
forgotten/omitted completely.

[how]
In the version-bump script:
* Use more modern regex
* Instead of copying the code use a loop

Create a commit with the bumped version information in all scripts.
This can only be done with the final job, because we have a problem to
checkout the modified version with actions/checkout.

We need to bump the version on every patch job, because we need the correct
information already in the script when we patch.

[note]
This does not prevent to have multiple commits attempts that change to the same
version. But if the change is empty, no commit will be added and the
step is silently ignored.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
d2b94f557b CI: Use GH action to upload release files
[why]
The self-written upload-archives script is some issues, for example it
does not replace preexisting release files with new ones when a release
is re-triggered. The error messages are rudimentary at best.

[how]
Use https://github.com/softprops/action-gh-release instead.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:50:06 +02:00
Fini Jastrow
f2ed019e63 CI: Remove outdated steps
[why]
Fonttools, FreeType, and HarfBuzz are not used in the CI job.
Propably a leftover from thomething done in the past?

[how]
Because I can not find out the reason WHY they are there the lines are
kept and just disabled. This leaves a nice 'stub' for git blame in the
file.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-24 10:22:27 +02:00
Fini
d08f9932c6
Merge pull request #806 from ryanoasis/feature/ci-use-2022-fontforge
CI: Include newest fontforge release in tests
2022-08-23 09:43:36 +02:00
Fini Jastrow
189bc8673f CI: Check file checksum and lowestRecPPEM on sample patched font
[why]
We 'manually' patch the font file after `fontforge` created it. This can
go wrong, for example we fail to create a correct new checksum.
Or we fail to patch the correct font property.

[how]
Also build `showttf` from the `fontforge` package and use it to extract
some font properties:
* Check the example patched font file checksum
* Compare the `lowestRecPPEM` of source to patched font file

[note]
`fontforge` set `lowestRecPPEM` always to 8 in generated fonts.
Hack has a value of 6.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-20 18:29:13 +02:00
Fini Jastrow
5ff4f92a23 CI: Use fontforge March 2022 AppImage
[why]
It might be easier to use the precompiled application than to build it
ourselves.

[how]
The AppImage has the typical problem with relative paths, so we need to
change some small calls.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-19 13:24:39 +02:00
Fini Jastrow
2050b4dc16 CI: Fix patch-em-all: Purge destination dirs if possible
[why]
The purged (obsolete) files are still existing after release.

[how]
We restore the deleted files before it adds the new ones.
Just delete all font files and then download all the release files (all
newly created fonts).

`git add` on a directory will remove all missing files.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-19 13:24:39 +02:00
Fini Jastrow
6e392c0b35 CI: Cache self-built fontforge for all steps
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-19 13:24:39 +02:00
Fini Jastrow
d43e6ea267 CI: Update action/checkout to v3
[why]
* Automatically does a shallow checkout, what we want anyhow
* Keep up to date

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-19 13:24:39 +02:00
Fini Jastrow
f4f890960d CI: Use fontforge March 2022 to create patched fonts
[why]
Fontforge 2020 March or 20th Anniversary have problems to generate fonts
with a lot of table entries. This is for example the massive entries for
ligatures in Iosevka. We can not generate valid font files with that
fontforge versions. We can not even detect (from Python side) if
fontforge had problems.

[how]
We fixed fontforge itself upstream with
  https://github.com/fontforge/fontforge/pull/4883

That fix became available first with Fontforge March 2022 Release.

We could use the AppImage or build from scratch, because no package is
available on Ubuntu 20.04 or 22.04.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-19 13:24:39 +02:00
Fini Jastrow
6e37782fcf CI: Correct release script call to patch-em-all
[why]
The font matix contains the directory names of the font files. The
directory names are taken from
  bin/scripts/lib/fonts.json
and specifically extracted with
  bin/scripts/get-font-names-from-json.sho

That script returns the .folderNames

Later in the release script we use the folder name to limit the fonts
that patch-em-all shall process. Unfortunately patch-em-all could (until
the previous commit) just work with font-filenames and not with
directory names. But the matrix gives us just directory names.

This is for example a problem with this fonts:
$ ll src/unpatched-fonts/BigBlueTerminal
-rw-rw-r-- 1 fini fini 25632 Jan  1 14:03 BigBlue_Terminal_437TT.TTF
-rw-rw-r-- 1 fini fini 69964 Jan  1 14:03 BigBlue_TerminalPlus.TTF

The *directory* of that fonts is correctly noted in fonts.json as
"BigBlueTerminal" but the font files do not begin with that!

[how]
Now, that patch-em-all can also filter on the directory name, we just
need to utilized that in the workflow run. If the filter shall work on
directory names the first character needs to be a slash, so we just
prepend it to name we got from the matix.

Fixes: #824

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-18 11:14:12 +02:00
Fini Jastrow
26d39bb8d1 CI: Include newest fontforge release in tests
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-03-11 12:40:26 +01:00
Ryan L McIntyre
b7866f2114 RC: Commit the patched font subset to the repo 2022-01-03 05:05:42 -08:00
Ryan L McIntyre
30d2a0427b Fix font patcher going to separate release 2022-01-03 03:47:23 -08:00
Ryan L McIntyre
1e65572c2c RC font-patcher archive missing creds 2022-01-03 03:27:10 -08:00
Ryan L McIntyre
3bb002c395 Add font patcher to release in separate job 2022-01-03 02:15:14 -08:00
Ryan L McIntyre
e630dd1697 Fixes use of archive, archive patcher and cleanup 2022-01-03 00:53:22 -08:00
Ryan L McIntyre
6748326a90 RC: Upload multiple paths 2022-01-01 10:23:38 -08:00
Ryan L McIntyre
c1d81cdda8 Tweak RC for less fonts and try wildcard pattern for artifact upload, comments out commit for now 2022-01-01 07:50:03 -08:00
Ryan L McIntyre
877fef6831 use smaller subset of fonts in RC and do a single commit using artifacts between jobs 2022-01-01 06:48:04 -08:00
Ryan L McIntyre
d3e09c2a29 Attempt fix build action 2021-12-31 08:11:51 -08:00
Ryan L McIntyre
c63600d124 Setup release action to pull version from file and commit back upon patching 2021-12-24 03:07:20 -08:00
Ryan L McIntyre
cc24e8b005 Adds workflow for testing out patcher 2021-12-05 07:54:47 -08:00
Ryan L McIntyre
dc3d40ee86 Archive script doing too much, tweak upload script and add ignore patterns to action 2021-11-26 07:49:18 -08:00
Ryan L McIntyre
387929546b Actions: debug + needs 2021-11-26 07:08:59 -08:00
Ryan L McIntyre
0657c3fc6c Setup matrix for actions 2021-11-26 06:48:25 -08:00
Ryan L McIntyre
e90d082ffc Rollback debugging after fixing version and open up to try patching all fonts 2021-11-21 13:26:03 -08:00
Ryan L McIntyre
26befdd2bf Workflow for building release candidate
* MOAR debug
2021-11-21 12:37:26 -08:00
Ryan L McIntyre
5be5d2c74b Workflow for building release candidate
* sanity check script updates of version
2021-11-21 12:16:20 -08:00
Ryan L McIntyre
70c00a3a80 Workflow for building release candidate
* fix incorrect version var passed to bump script
2021-11-21 08:41:26 -08:00
Ryan L McIntyre
b8a31a67dd Workflow for building release candidate
* fix incorrect script
2021-11-21 08:19:47 -08:00
Ryan L McIntyre
6d21c4ebc2 Workflow for building release candidate 2021-11-21 08:08:35 -08:00
Marcus Schweda
5dfd0aafaf GitHub workflow 2020-03-06 23:12:46 +01:00