diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index fd0ba2d2bb..26bc485129 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -16,7 +16,7 @@ jobs: name: Publish image runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build image run: docker build -t nerdfonts/patcher . - name: Push image diff --git a/.github/workflows/font-patcher.yml b/.github/workflows/font-patcher.yml index fdfdff91b5..e1ef657c6c 100644 --- a/.github/workflows/font-patcher.yml +++ b/.github/workflows/font-patcher.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v3 - name: Setup core dependencies run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2506cae67..65dbea66e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,10 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: '1' + - uses: actions/checkout@v3 - id: set-matrix run: | @@ -60,11 +57,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: '1' - + - uses: actions/checkout@v3 - name: Set release variables run: | cd -- "$GITHUB_WORKSPACE" @@ -83,10 +76,22 @@ jobs: run: | sudo apt update -y -q sudo apt install software-properties-common -y -q - sudo apt update -y -q - sudo apt install fontforge -y -q sudo apt install python3-fontforge -y -q + # Ubuntu 20.04 has only fontforge release 2020, but there are some vital bugfixes in the 2022 release + # This can be replaced with the ordinary apt package when Ubuntu updates, probably with 22.10? + - name: Fetch FontForge + run: | + curl -L "https://github.com/fontforge/fontforge/releases/download/20220308/FontForge-2022-03-08-582bd41-x86_64.AppImage" \ + --output fontforge + chmod u+x fontforge + echo Try appimage + ./fontforge --version + export PATH=`pwd`:$PATH + echo "PATH=$PATH" >> $GITHUB_ENV + echo Try appimage with path + fontforge --version + - name: Setup additional dependencies run: | pip install fonttools --quiet @@ -129,7 +134,7 @@ jobs: - name: Patch all the variations of the font family run: | cd -- "$GITHUB_WORKSPACE/bin/scripts" - fontforge --script ../../font-patcher --version + fontforge --script `pwd`/../../font-patcher --version ./gotta-patch-em-all-font-patcher\!.sh "/${{ matrix.font }}" - name: Generate fontconfig and casks @@ -164,8 +169,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v3 - name: Set release variables run: | cd -- "$GITHUB_WORKSPACE" @@ -193,7 +197,11 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Prepare repo (clear out old and obsolete fonts) + run: | + cd -- "$GITHUB_WORKSPACE/patched-fonts" + find . -name "*.[to]tf" -exec rm {} \; - name: Download patched fonts from build id: download-patched-fonts @@ -202,9 +210,9 @@ jobs: name: patched-fonts path: . - - uses: EndBug/add-and-commit@v7 + - uses: EndBug/add-and-commit@v9 with: add: 'patched-fonts' message: Rebuilds patched fonts committer_name: GitHub Actions - committer_email: 41898282+github-actions[bot]@users.noreply.github.com \ No newline at end of file + committer_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/bin/scripts/gotta-patch-em-all-font-patcher!.sh b/bin/scripts/gotta-patch-em-all-font-patcher!.sh index 8aea4bfcfa..56ba97d2a7 100755 --- a/bin/scripts/gotta-patch-em-all-font-patcher!.sh +++ b/bin/scripts/gotta-patch-em-all-font-patcher!.sh @@ -13,7 +13,7 @@ # If the argument starts with a '/' all font files in a directory that matches # the filter are processed only. # Example ./gotta-patch-em-all-font-patcher\!.sh "/iosevka" -# Process all font files that are in directories that start with "iosevka" +# Process all font files that are in directory "iosevka" # for executing script to rebuild JUST the readmes: # ./gotta-patch-em-all-font-patcher\!.sh "" info @@ -55,7 +55,7 @@ then if [[ "${1:0:1}" == "/" ]] then like_mode="-ipath" - like_pattern="*$1*/*.[o,t]tf" + like_pattern="*$1/*.[o,t]tf" echo "$LINE_PREFIX Parameter given, limiting search and patch to pathname pattern '$1' given" else like_mode="-iname" @@ -141,11 +141,12 @@ function patch_font { echo >&2 "# Could not find project parent directory" exit 1 } - - fontforge -quiet -script ./font-patcher "$f" -q $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null - fontforge -quiet -script ./font-patcher "$f" -q -s ${font_config} $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null - fontforge -quiet -script ./font-patcher "$f" -q -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null - fontforge -quiet -script ./font-patcher "$f" -q -s ${font_config} -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null + # Use absolute path to allow fontforge being an AppImage (used in CI) + PWD=`pwd` + fontforge -quiet -script $PWD/font-patcher "$f" -q $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null + fontforge -quiet -script $PWD/font-patcher "$f" -q -s ${font_config} $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null + fontforge -quiet -script $PWD/font-patcher "$f" -q -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null + fontforge -quiet -script $PWD/font-patcher "$f" -q -s ${font_config} -w $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" 2>/dev/null # wait for this group of background processes to finish to avoid forking too many processes # that can add up quickly with the number of combinations #wait