-
Notifications
You must be signed in to change notification settings - Fork 33
228 lines (217 loc) · 10.5 KB
/
ci.yaml
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: ci
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
# schedule:
# - cron: "0 13 * * *"
jobs:
check-for-new-cascadia:
runs-on: ubuntu-22.04
outputs:
tag_name: ${{ env.CASCADIATAG }}
tag_exists: ${{ steps.check_tag.outputs.exists }}
steps:
- name: Fetch latest release of Cascadia Code
uses: octokit/request-action@v2.x
id: get_latest_release
with:
route: GET /repos/microsoft/cascadia-code/releases/latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get the latest Cascadia tag
run: |
echo "CASCADIATAG=${{ fromJson(steps.get_latest_release.outputs.data).tag_name }}" >> $GITHUB_ENV
- name: Check if tag exists
uses: mukunku/tag-exists-action@v1.6.0
id: check_tag
with:
tag: ${{ env.CASCADIATAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Summary
run: |
echo "Latest Cascadia tag is $CASCADIATAG"
build-and-release:
needs: check-for-new-cascadia
if: ${{ github.event_name != 'schedule' || needs.check-for-new-cascadia.outputs.tag_exists != 'true' }}
runs-on: ubuntu-22.04
env:
CASCADIATAG: ${{ needs.check-for-new-cascadia.outputs.tag_name }}
CASCADIATAG_ISNOTNEW: ${{ needs.check-for-new-cascadia.outputs.tag_exists }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Decide on version
run: |
if [ "${CASCADIATAG_ISNOTNEW}" = "false" ]; then
echo New release is not tagged yet in our repo
echo It will only be tagged after successfull release in job 'Create tag'
OURVERSION=${CASCADIATAG}
else
echo Re-release uses our manual tags and/or patchlevel
OURVERSION=`git describe --always --tags`
fi
echo "OURVERSION=${OURVERSION}" >> $GITHUB_ENV
- name: Download latest version of Cascadia
uses: robinraju/release-downloader@v1.10
with:
repository: "microsoft/cascadia-code"
tag: ${{ needs.check-for-new-cascadia.outputs.tag_name }}
fileName: "*.zip"
- name: Open Cascadia release
run: |
unzip CascadiaCode*.zip 'ttf/*'
# 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?
# On the other hand ... why not be on the latest release always?
- name: Fetch FontForge
run: |
sudo apt install software-properties-common python3-fontforge fuse -y -q
curl -L "https://github.com/fontforge/fontforge/releases/download/20230101/FontForge-2023-01-01-a1dad3e-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: Get Font Patcher
uses: robinraju/release-downloader@v1.x
with:
repository: "ryanoasis/nerd-fonts"
latest: true
fileName: "FontPatcher.zip"
- name: Open Font Patcher release
run: |
unzip FontPatcher.zip
- name: Install PIP
run: sudo apt install python3-pip -y
- name: Install configparser
run: pip3 install configparser
- name: Extract additional powerline glyphs
run: fontforge -lang=ff -script "`pwd`/extract-extra-glyphs" "`pwd`" `pwd`/src/glyphs/octicons/octicons.ttf
- name: Build Powerline
run: |
./do_generate 01 --powerline --mono CascadiaCodePL-Regular.ttf DelugiaPL.ttf "Delugia PL"
./do_generate 02 --powerline --mono CascadiaCodePL-Bold.ttf DelugiaPL-Bold.ttf "Delugia PL"
./do_generate 03 --powerline --mono CascadiaCodePL-Italic.ttf DelugiaPL-Italic.ttf "Delugia PL"
./do_generate 04 --powerline --mono CascadiaCodePL-BoldItalic.ttf DelugiaPL-BoldItalic.ttf "Delugia PL"
./do_generate 05 --powerline --mono CascadiaCodePL-Light.ttf DelugiaPLLight.ttf "Delugia PL"
./do_generate 06 --powerline --mono CascadiaCodePL-LightItalic.ttf DelugiaPLLight-Italic.ttf "Delugia PL"
mkdir delugia-powerline
mv Delugia*ttf delugia-powerline
zip delugia-powerline.zip delugia-powerline/*
- name: Build MonoPowerline
run: |
./do_generate 11 --powerline --mono CascadiaMonoPL-Regular.ttf DelugiaMonoPL.ttf "Delugia PL Mono"
./do_generate 12 --powerline --mono CascadiaMonoPL-Bold.ttf DelugiaMonoPL-Bold.ttf "Delugia PL Mono"
./do_generate 13 --powerline --mono CascadiaMonoPL-Italic.ttf DelugiaMonoPL-Italic.ttf "Delugia PL Mono"
./do_generate 14 --powerline --mono CascadiaMonoPL-BoldItalic.ttf DelugiaMonoPL-BoldItalic.ttf "Delugia PL Mono"
./do_generate 15 --powerline --mono CascadiaMonoPL-Light.ttf DelugiaMonoPLLight.ttf "Delugia PL Mono"
./do_generate 16 --powerline --mono CascadiaMonoPL-LightItalic.ttf DelugiaMonoPLLight-Italic.ttf "Delugia PL Mono"
mkdir delugia-mono-powerline
mv Delugia*ttf delugia-mono-powerline
zip delugia-mono-powerline.zip delugia-mono-powerline/*
- name: Build Complete
run: |
./do_generate 21 -c --mono CascadiaCodePL-Regular.ttf DelugiaComplete.ttf "Delugia"
./do_generate 22 -c --mono CascadiaCodePL-Bold.ttf DelugiaComplete-Bold.ttf "Delugia"
./do_generate 23 -c --mono CascadiaCodePL-Italic.ttf DelugiaComplete-Italic.ttf "Delugia"
./do_generate 24 -c --mono CascadiaCodePL-BoldItalic.ttf DelugiaComplete-BoldItalic.ttf "Delugia"
./do_generate 25 -c --mono CascadiaCodePL-Light.ttf DelugiaCompleteLight.ttf "Delugia"
./do_generate 26 -c --mono CascadiaCodePL-LightItalic.ttf DelugiaCompleteLight-Italic.ttf "Delugia"
mkdir delugia-complete
mv Delugia*ttf delugia-complete
zip delugia-complete.zip delugia-complete/*
- name: Build Mono Complete
run: |
./do_generate 31 -c --mono CascadiaMonoPL-Regular.ttf DelugiaMonoComplete.ttf "Delugia Mono"
./do_generate 32 -c --mono CascadiaMonoPL-Bold.ttf DelugiaMonoComplete-Bold.ttf "Delugia Mono"
./do_generate 33 -c --mono CascadiaMonoPL-Italic.ttf DelugiaMonoComplete-Italic.ttf "Delugia Mono"
./do_generate 34 -c --mono CascadiaMonoPL-BoldItalic.ttf DelugiaMonoComplete-BoldItalic.ttf "Delugia Mono"
./do_generate 35 -c --mono CascadiaMonoPL-Light.ttf DelugiaMonoCompleteLight.ttf "Delugia Mono"
./do_generate 36 -c --mono CascadiaMonoPL-LightItalic.ttf DelugiaMonoCompleteLight-Italic.ttf "Delugia Mono"
mkdir delugia-mono-complete
mv Delugia*ttf delugia-mono-complete
zip delugia-mono-complete.zip delugia-mono-complete/*
- name: Build Book Complete
run: |
./do_generate 41 -c -c CascadiaCodePL-Regular.ttf DelugiaBook.ttf "Delugia Book"
./do_generate 42 -c -c CascadiaCodePL-Bold.ttf DelugiaBook-Bold.ttf "Delugia Book"
./do_generate 43 -c -c CascadiaCodePL-Italic.ttf DelugiaBook-Italic.ttf "Delugia Book"
./do_generate 44 -c -c CascadiaCodePL-BoldItalic.ttf DelugiaBook-BoldItalic.ttf "Delugia Book"
./do_generate 45 -c -c CascadiaCodePL-Light.ttf DelugiaBookLight.ttf "Delugia Book"
./do_generate 46 -c -c CascadiaCodePL-LightItalic.ttf DelugiaBookLight-Italic.ttf "Delugia Book"
mkdir delugia-book
mv Delugia*ttf delugia-book
zip delugia-book.zip delugia-book/*
- name: Check for preexisting glyphs
run: |
grep 'Skipping...' process*.log | grep -vE ' Powerline(Extra)?Symbols>'
- uses: actions/upload-artifact@v4
with:
name: Delugia Powerline
path: "delugia-powerline"
- uses: actions/upload-artifact@v4
with:
name: Delugia Mono Powerline
path: "delugia-mono-powerline"
- uses: actions/upload-artifact@v4
with:
name: Delugia Complete
path: "delugia-complete"
- uses: actions/upload-artifact@v4
with:
name: Delugia Mono Complete
path: "delugia-mono-complete"
- uses: actions/upload-artifact@v4
with:
name: Delugia Book
path: "delugia-book"
# Release part
- name: Create tag
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') && needs.check-for-new-cascadia.outputs.tag_exists != 'true' }}
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
const tagName = "${{ needs.check-for-new-cascadia.outputs.tag_name }}";
const createdTag = await github.git.createTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tagName,
message: `Bump Delugia version to ${tagName}`,
object: context.sha,
type: "commit"
})
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${tagName}`,
sha: createdTag.data.sha
})
- name: Get tag name
id: get_tag_name
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: battila7/get-version-action@v2
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || needs.check-for-new-cascadia.outputs.tag_exists != 'true') }}
with:
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && steps.get_tag_name.outputs.version || needs.check-for-new-cascadia.outputs.tag_name }}
files: |
delugia-powerline.zip
delugia-mono-powerline.zip
delugia-complete.zip
delugia-mono-complete.zip
delugia-book.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}