-
Notifications
You must be signed in to change notification settings - Fork 686
161 lines (160 loc) · 6.29 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI
on:
push:
branches: [ master, releases/** ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
linux:
runs-on: ${{ matrix.os }}
env:
PYTHON: python3.10
strategy:
matrix:
os: ["ubuntu-latest"]
target: ["NoUI", "Debug"]
include:
- os: ubuntu-20.04
target: Release
steps:
- uses: actions/checkout@v3
with:
path: repo
- name: Restore cached custom dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: deps/install
key: ${{ matrix.os }}-deps-${{ hashFiles('repo/.github/workflows/scripts/setup_linux_deps.sh') }}
- name: Install dependencies and setup env vars
run: ${{ github.workspace }}/repo/.github/workflows/scripts/setup_linux_deps.sh
- name: Build FontForge
working-directory: repo
run: |
FFCONFIG="-DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_FONTFORGE_EXTRAS=ON -DENABLE_FREETYPE_DEBUGGER=$DEPSPREFIX/freetype"
if [ "${{ matrix.target }}" == "Debug" ]; then
FFCONFIG="$FFCONFIG -DENABLE_X11=ON -DENABLE_CODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_DOCS=ON -DSPHINX_USE_VENV=ON"
elif [ "${{ matrix.target }}" == "NoUI" ]; then
FFCONFIG="$FFCONFIG -DENABLE_GUI=OFF -DENABLE_PYTHON_SCRIPTING=OFF"
fi
mkdir build && pushd build && cmake -GNinja $FFCONFIG .. && popd
ninja -C build all potfiles install
- name: Run FontForge tests
run: CTEST_PARALLEL_LEVEL=100 ninja -C repo/build check
- name: Build dist bundle
if: matrix.target == 'NoUI'
run: ninja -C repo/build dist
- name: Run pyhook smoke test
if: matrix.target != 'NoUI'
run: $PYTHON repo/tests/pyhook_smoketest.py
- name: Build AppImage
if: matrix.target == 'Release'
working-directory: repo/build
run: |
DESTDIR=appdir cmake -DCMAKE_INSTALL_PREFIX=/usr -P cmake_install.cmake
../.github/workflows/scripts/ffappimagebuild.sh appdir $GITHUB_SHA
- name: Dist archive artifact
uses: actions/upload-artifact@v3
if: matrix.target == 'NoUI'
with:
name: dist-archive
path: repo/build/fontforge-*.tar.xz
- name: AppImage artifact
uses: actions/upload-artifact@v3
if: matrix.target == 'Release'
with:
name: appimage
path: repo/build/FontForge-*-x86_64.AppImage
- name: Update Potfile for Crowdin
if: matrix.target == 'Release' && github.ref == 'refs/heads/master' && github.repository == 'fontforge/fontforge' && github.event_name == 'push'
working-directory: repo
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
run: java -jar $DEPSPREFIX/crowdin-cli.jar -c .crowdin.yml upload
mac:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
path: repo
- name: Install dependencies
run: |
# Disable fc-cache on fontconfig install. Because it's slow.
sed -i.bak '/fc-cache/d' "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/f/fontconfig.rb"
brew install pkg-config ruby cmake ninja
brew install cairo coreutils fontconfig gettext giflib gtk+3 jpeg libpng libspiro libtiff libtool libuninameslist python@3 wget woff2
PREFIX=$GITHUB_WORKSPACE/target
echo "PREFIX=$PREFIX" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig" >> $GITHUB_ENV
echo "PATH=/usr/local/opt/ruby/bin:/usr/local/opt/gettext/bin:$PATH" >> $GITHUB_ENV
# System Python libraries will be discovered by CMake
echo "PYTHONPATH=$PREFIX" >> $GITHUB_ENV
- name: Build FontForge
working-directory: repo
run: |
FFCONFIG="-DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_FONTFORGE_EXTRAS=ON -DCMAKE_FIND_ROOT_PATH=/usr/local/opt/gettext"
mkdir build && pushd build && cmake -GNinja $FFCONFIG .. && popd
ninja -C build install
- name: Run FontForge tests
working-directory: repo
run: CTEST_PARALLEL_LEVEL=100 ninja -C build check
- name: Run pyhook smoke test
working-directory: repo
run: |
# MacOS runner has way too much preinstalled Python versions. We must
# use the exact one discovered by CMake.
PYTHON=`cat build/CMake_Python3_EXECUTABLE`
PYTHONPATH=$PYTHONPATH:$PREFIX/$($PYTHON -c "import distutils.sysconfig as sc; print(sc.get_python_lib(prefix='', plat_specific=True,standard_lib=False))")
$PYTHON tests/pyhook_smoketest.py
- name: Build App Bundle
working-directory: repo/build
run: ninja macbundle
- name: App Bundle artifact
uses: actions/upload-artifact@v3
with:
name: appbundle
path: repo/build/osx/FontForge-*.dmg
windows:
runs-on: windows-latest
env:
MSYS2_FC_CACHE_SKIP: true
strategy:
matrix:
arch: ["MINGW32", "MINGW64"]
steps:
- uses: actions/checkout@v3
with:
path: repo
- name: Checkout FontForgeBuilds
uses: actions/checkout@v3
with:
repository: fontforge/fontforgebuilds
path: fontforgebuilds
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.arch }}
update: true
install: git
- name: Run FontForgeBulds initialisation
working-directory: fontforgebuilds
shell: msys2 {0}
run: ./ffbuild.sh --github-actions --depsonly
- name: Run FontForgeBuilds
working-directory: fontforgebuilds
shell: msys2 {0}
run: |
./ffbuild.sh --github-actions
FFPATH=`cygpath -m "$GITHUB_WORKSPACE/repo"` ./make-portable-package.sh ci
- name: Run InnoSetup
if: github.ref == 'refs/heads/master'
working-directory: fontforgebuilds/fontforge-setup
run: iscc -Qp fontforgesetup.iss -DMSYSTEM=${{ matrix.arch }}
- name: Build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch }}
path: |
fontforgebuilds/*.7z
fontforgebuilds/fontforge-setup/*.exe