Skip to content

Commit

Permalink
Sunset in-repo releases
Browse files Browse the repository at this point in the history
[why]
We struggle with the pack-committing of patched fonts to the repository
on release. This makes our repo grow extremely big. It would be better
to just use release artifacts for the releases and not commit any
patched font back.
There were different approaches discussed, but the problem remains that
I personally have no rights to implement anything of that - neither can
I force push to the default branch, nor can I create new repos in the
organization.

[how]
To make it still possible to add new fonts without a repo size
explosion we do not release NEW fonts back to the repository as commits,
but old fonts are handled as before.
NEW fonts:
 * have a new property set in the fonts.yaml 'database'
 * are released as release artifact via release workflow (but not
   committed back)
 * get a readme in the patched_fonts/ directory that points to the
   release artifact page

The solution is not ideal, but for sure better than not adding any fonts
anymore or having the repo grow in size faster and faster.

At some point in time I would like to phase out all in-repo releases,
also for OLD fonts.

This scheme has been (manually) used / introduced for Intel One.
With this change the .gitignore file is automatically adapted to any new
font that is added with the repoRelease flag set to false (which should
be the default for any added font from now on).

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Sep 27, 2023
1 parent e398a38 commit 090fbbe
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/pages.yml → .github/workflows/fontjson.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update gh-pages
name: Update gitignore and gh-pages

on:
push:
Expand All @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
sync:
sync_pages:
runs-on: ubuntu-latest
steps:
- name: Fetch files
Expand Down Expand Up @@ -43,3 +43,22 @@ jobs:
git-config-name: GitHub Actions
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
clean: false

update_gitignore:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Regenerate gitignore
run: |
cd bin/scripts
./update-gitignore.sh
- name: Commit gitignore back to repo
uses: EndBug/add-and-commit@v9
with:
fetch: false
add: ".gitignore"
message: "[ci] Update .gitignore file"
committer_name: GitHub Actions
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ jobs:
- name: Commit patched fonts back to repo
# For fonts with repoRelease == false in the font.json the gitignore should
# have been setup in a way that this commits only the README.md
# See also fontjson.yml and update-gitignore.sh
uses: EndBug/add-and-commit@v9
with:
fetch: false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ bin/scripts/name_parser/__pycache__/*
bin/scripts/name_parser/log
# This is just needed for the cheat sheet and not go into the repo:
css/nerd-fonts-generated-removed.min.css
# AUTOGENERATED lines follow, do not change or remove the comments
# Non-Repo-Released fonts, see fonts.json:
patched-fonts/IntelOneMono/*
!patched-fonts/IntelOneMono/README.md
# AUTOGENERATED lines end
2 changes: 2 additions & 0 deletions bin/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Note: Usually you need to call the scripts in this directory while actually bein
* `test-powerlines.sh`: Print-to-debug powerline examples [4]
* `tests.sh`: Create some font usage gif movie? [x]
* `update-all-contributors-website.py`: Update the contributors page on `nerdfonts.com` (i.e. gh-pages) [7]
* `update-gitignore.sh`: Correct gitignore file for not-released-in-repo fonts [8]
* `version-bump.sh`: Change version number in all scripts on a new release [1]

[1] Used by CI (github release workflow)
Expand All @@ -39,4 +40,5 @@ Note: Usually you need to call the scripts in this directory while actually bein
[5] Used by CI (github packsvgs workflow)
[6] Used by CI (github casks workflow)
[7] Used by CI (github contributors workflow)
[8] Used by CI (github fontjson workflow)
[x] Probably not used by anything
Loading

0 comments on commit 090fbbe

Please sign in to comment.