2021-12-24 13:06:20 +02:00
|
|
|
# triggers a release or a release candidate based on the version defined in package.json
|
2021-11-21 18:08:35 +02:00
|
|
|
|
2021-12-24 13:06:20 +02:00
|
|
|
name: Release
|
2021-11-21 18:08:35 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
# Triggers the workflow on push or pull request events but only for the master branch
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
2021-11-26 17:49:18 +02:00
|
|
|
paths-ignore:
|
|
|
|
- 'images/**'
|
|
|
|
- '**.md'
|
|
|
|
- '.all-contributorsrc'
|
|
|
|
- 'chocolatey/**'
|
|
|
|
- 'bin/scripts/lib/**'
|
|
|
|
- 'Dockerfile'
|
|
|
|
- 'install.ps1'
|
|
|
|
- 'install.sh'
|
|
|
|
- 'LICENSE'
|
|
|
|
- 'package**'
|
2021-11-21 18:08:35 +02:00
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2021-11-26 16:46:46 +02:00
|
|
|
setup-fonts-matrix:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-11-26 17:49:18 +02:00
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
fetch-depth: '1'
|
2021-11-26 16:46:46 +02:00
|
|
|
-
|
|
|
|
id: set-matrix
|
|
|
|
run: |
|
|
|
|
cd -- $GITHUB_WORKSPACE/bin/scripts/
|
|
|
|
fontNames=$(./get-font-names-from-json.sh)
|
2021-11-26 17:08:59 +02:00
|
|
|
echo "${fontNames}"
|
2021-11-26 16:46:46 +02:00
|
|
|
echo "::set-output name=matrix::${fontNames}"
|
2021-11-26 17:08:59 +02:00
|
|
|
echo ${{ steps.set-matrix.outputs.matrix }}
|
2021-11-26 16:46:46 +02:00
|
|
|
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
|
2021-11-21 18:08:35 +02:00
|
|
|
# Workflow to build and install dependencies
|
|
|
|
build:
|
|
|
|
# The type of runner that the job will run on
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2021-11-26 17:08:59 +02:00
|
|
|
needs: setup-fonts-matrix
|
|
|
|
|
2021-11-21 18:08:35 +02:00
|
|
|
env:
|
|
|
|
GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-11-26 16:46:46 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
font: ${{fromJson(needs.setup-fonts-matrix.outputs.matrix)}}
|
|
|
|
|
2021-11-21 18:08:35 +02:00
|
|
|
steps:
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
fetch-depth: '1'
|
|
|
|
|
2021-12-24 13:06:20 +02:00
|
|
|
- name: Set release variables
|
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE"
|
|
|
|
cat package.json
|
|
|
|
RELEASE_TAG_VERSION=$(cat package.json \
|
|
|
|
| grep version \
|
|
|
|
| head -1 \
|
|
|
|
| awk -F: '{ print $2 }' \
|
|
|
|
| sed 's/[",]//g')
|
|
|
|
echo "RELEASE_TAG_VERSION=$RELEASE_TAG_VERSION" >> $GITHUB_ENV
|
|
|
|
[[ "$RELEASE_TAG_VERSION" == *"-RC"* ]] && echo "RELEASE_CANDIDATE=true" || echo "RELEASE_CANDIDATE=false" >> $GITHUB_ENV
|
|
|
|
|
2021-11-21 18:08:35 +02:00
|
|
|
# Install and setup Dependencies
|
2021-11-26 16:46:46 +02:00
|
|
|
# @TODO cache the next 4 steps with actions/cache or upload
|
2021-11-21 18:08:35 +02:00
|
|
|
- name: Setup core dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update -y -q
|
|
|
|
sudo apt install software-properties-common -y -q
|
|
|
|
sudo apt install python3-fontforge -y -q
|
|
|
|
|
2022-08-18 14:47:34 +02:00
|
|
|
# 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: Install FontForge (self built)
|
|
|
|
run: |
|
|
|
|
sudo apt install libjpeg-dev libtiff5-dev libpng-dev libfreetype6-dev libgif-dev libgtk-3-dev libxml2-dev libpango1.0-dev libcairo2-dev libspiro-dev python3-dev ninja-build cmake build-essential gettext libuninameslist-dev -y -q
|
|
|
|
curl -Lv "https://github.com/fontforge/fontforge/releases/download/20220308/fontforge-20220308.tar.xz" \
|
|
|
|
--output FontForge.tar.xz
|
|
|
|
tar -xf FontForge.tar.xz
|
|
|
|
cd fontforge-*
|
|
|
|
sudo mkdir build
|
|
|
|
cd build
|
|
|
|
sudo cmake -GNinja ..
|
|
|
|
sudo ninja
|
|
|
|
sudo ninja install
|
|
|
|
|
2021-11-21 18:08:35 +02:00
|
|
|
- name: Setup additional dependencies
|
|
|
|
run: |
|
|
|
|
pip install fonttools --quiet
|
|
|
|
|
|
|
|
- name: Build FreeType from source
|
|
|
|
run: |
|
|
|
|
wget http://downloads.sourceforge.net/project/freetype/freetype2/2.7/freetype-2.7.tar.gz --quiet
|
|
|
|
tar -zxf freetype-2.7.tar.gz
|
|
|
|
cd freetype-2.7
|
|
|
|
./configure
|
|
|
|
make --quiet
|
|
|
|
sudo make install --quiet
|
|
|
|
|
|
|
|
- name: Build Harfbuzz from source
|
|
|
|
run: |
|
|
|
|
wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.3.4.tar.bz2 --quiet
|
|
|
|
tar -xjf harfbuzz-1.3.4.tar.bz2
|
|
|
|
cd harfbuzz-1.3.4
|
|
|
|
./configure
|
|
|
|
make --quiet
|
|
|
|
sudo make install --quiet
|
|
|
|
|
|
|
|
- name: Verify setup
|
|
|
|
run: |
|
|
|
|
fontforge --version
|
|
|
|
fontforge --version 2>&1 | grep libfontforge | awk '{print $NF}'
|
|
|
|
|
2021-12-31 18:11:51 +02:00
|
|
|
- name: Bump version for source files once
|
2022-01-01 16:47:57 +02:00
|
|
|
# @todo fixme - put in a separate job with the release env setup and output the release info
|
2021-12-31 18:11:51 +02:00
|
|
|
if: ${{ matrix.font == '3270' }}
|
2021-11-21 18:08:35 +02:00
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
2021-11-21 18:41:26 +02:00
|
|
|
./version-bump.sh "$RELEASE_TAG_VERSION"
|
2021-12-31 18:11:51 +02:00
|
|
|
|
|
|
|
- name: Standardize the readme files
|
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
2021-11-26 16:46:46 +02:00
|
|
|
./standardize-and-complete-readmes.sh "${{ matrix.font }}"
|
2021-11-21 18:08:35 +02:00
|
|
|
|
2021-12-24 13:06:20 +02:00
|
|
|
- name: Patch all the variations of the font family
|
2021-11-21 18:08:35 +02:00
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
2021-11-21 22:37:26 +02:00
|
|
|
fontforge --script ../../font-patcher --version
|
2022-04-22 13:51:33 +02:00
|
|
|
./gotta-patch-em-all-font-patcher\!.sh "/${{ matrix.font }}"
|
2021-11-21 18:08:35 +02:00
|
|
|
|
|
|
|
- name: Generate fontconfig and casks
|
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
|
|
|
./generate-fontconfig.sh
|
2021-11-26 16:46:46 +02:00
|
|
|
./generate-casks.sh "${{ matrix.font }}"
|
2021-11-21 18:08:35 +02:00
|
|
|
|
2021-11-21 23:26:03 +02:00
|
|
|
- name: Archive font package zip files and upload for release
|
2021-11-21 18:08:35 +02:00
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
2021-11-26 17:49:18 +02:00
|
|
|
./archive-fonts.sh "${{ matrix.font }}"
|
2021-12-24 13:06:20 +02:00
|
|
|
GITHUB_TOKEN=$GITHUB_TOKEN PRERELEASE=$RELEASE_CANDIDATE ./upload-archives.sh $RELEASE_TAG_VERSION "${{ matrix.font }}"
|
2022-01-01 16:47:57 +02:00
|
|
|
|
|
|
|
- name: Upload patched fonts as artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: patched-fonts
|
2022-01-03 10:53:22 +02:00
|
|
|
# adding multiple paths (i.e. LICENSE) is a workaround to get a least common ancestor
|
|
|
|
# of the root directory for artifact path purposes
|
2022-01-01 20:23:38 +02:00
|
|
|
path: |
|
2022-01-03 10:53:22 +02:00
|
|
|
patched-fonts/${{ matrix.font }}
|
|
|
|
LICENSE
|
2022-01-01 16:47:57 +02:00
|
|
|
|
2022-01-03 12:15:14 +02:00
|
|
|
release-font-patcher:
|
|
|
|
name: Archive font patcher and add to release
|
|
|
|
needs: build
|
2022-01-03 13:27:10 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-01-03 12:15:14 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2022-01-03 13:47:23 +02:00
|
|
|
- name: Set release variables
|
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE"
|
|
|
|
cat package.json
|
|
|
|
RELEASE_TAG_VERSION=$(cat package.json \
|
|
|
|
| grep version \
|
|
|
|
| head -1 \
|
|
|
|
| awk -F: '{ print $2 }' \
|
|
|
|
| sed 's/[",]//g')
|
|
|
|
echo "RELEASE_TAG_VERSION=$RELEASE_TAG_VERSION" >> $GITHUB_ENV
|
|
|
|
[[ "$RELEASE_TAG_VERSION" == *"-RC"* ]] && echo "RELEASE_CANDIDATE=true" || echo "RELEASE_CANDIDATE=false" >> $GITHUB_ENV
|
|
|
|
|
2022-01-03 12:15:14 +02:00
|
|
|
- name: Archive font-patcher script for release
|
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
|
|
|
./archive-font-patcher.sh
|
|
|
|
|
|
|
|
- name: Archive font package zip files and upload for release
|
|
|
|
run: |
|
|
|
|
cd -- "$GITHUB_WORKSPACE/bin/scripts"
|
|
|
|
GITHUB_TOKEN=$GITHUB_TOKEN PRERELEASE=$RELEASE_CANDIDATE ./upload-archives.sh $RELEASE_TAG_VERSION "FontPatcher"
|
|
|
|
|
2022-01-01 16:47:57 +02:00
|
|
|
commit:
|
|
|
|
name: Commit and push patched fonts to the repo
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Download patched fonts from build
|
2022-01-03 10:53:22 +02:00
|
|
|
id: download-patched-fonts
|
2022-01-01 16:47:57 +02:00
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: patched-fonts
|
2022-01-03 10:53:22 +02:00
|
|
|
path: .
|
2022-01-01 16:47:57 +02:00
|
|
|
|
2022-01-03 15:05:42 +02:00
|
|
|
- uses: EndBug/add-and-commit@v7
|
|
|
|
with:
|
|
|
|
add: 'patched-fonts'
|
|
|
|
message: Rebuilds patched fonts
|
|
|
|
committer_name: GitHub Actions
|
|
|
|
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
|