Skip to content

Commit 5cba643

Browse files
committed
Add combined PDF to the combined-deck CI artifact
Mirror the per-language pandoc/tectonic recipe for the combined deck so each release also ships a single PDF covering every language.
1 parent 5cfe2eb commit 5cba643

3 files changed

Lines changed: 35 additions & 6 deletions

File tree

.github/workflows/build-artifacts.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,35 @@ jobs:
8585
nix_path: nixpkgs=channel:nixos-23.11
8686
github_access_token: ${{ secrets.GITHUB_TOKEN }}
8787

88-
- name: Build combined Anki deck with Nix
88+
- name: Make Hasklug font visible to tectonic
89+
run: |
90+
nix develop --command true
91+
mkdir -p ~/Library/Fonts
92+
for dir in /nix/store/*-nerd-fonts-hasklug-*/share/fonts; do
93+
[ -d "$dir" ] || continue
94+
find "$dir" -type f \( -name "*.otf" -o -name "*.ttf" \) \
95+
-exec cp -n {} ~/Library/Fonts/ \;
96+
done
97+
echo "Installed fonts:"
98+
ls ~/Library/Fonts/ | grep -i hasklug | head
99+
100+
- name: Build combined Anki deck and PDF with Nix
89101
run: |
90102
nix develop --command bash -c 'make build-combined'
91103
92-
- name: Upload combined deck to workflow run
104+
- name: Upload combined artifacts to workflow run
93105
uses: actions/upload-artifact@v7
94106
with:
95107
name: cards-combined
96-
path: cards-combined.apkg
108+
path: |
109+
cards-combined.apkg
110+
cards-combined.pdf
97111
if-no-files-found: error
98112

99113
- name: Release
100114
if: startsWith(github.ref, 'refs/tags/v')
101115
uses: softprops/action-gh-release@v2
102116
with:
103-
files: cards-combined.apkg
117+
files: |
118+
cards-combined.apkg
119+
cards-combined.pdf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.direnv
22
cards-combined.md
33
cards-combined.apkg
4+
cards-combined.pdf

makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,20 @@ cards-combined.apkg: cards-combined.md
2626
anki-panky $<
2727

2828

29+
cards-combined.pdf: cards-combined.md
30+
pandoc \
31+
--pdf-engine tectonic \
32+
--variable "geometry:papersize={130mm,130mm}" \
33+
--variable "fontsize: 10pt" \
34+
--variable "monofont:Hasklug Nerd Font Mono" \
35+
--variable "monofontoptions:Scale=0.7, FontFace={weight=700}" \
36+
--to beamer \
37+
--output $@ \
38+
$<
39+
40+
2941
.PHONY: build-combined
30-
build-combined: cards-combined.apkg
42+
build-combined: cards-combined.apkg cards-combined.pdf
3143

3244

3345
.PHONY: test
@@ -40,7 +52,7 @@ test:
4052

4153
.PHONY: clean
4254
clean:
43-
rm -f cards-combined.md cards-combined.apkg
55+
rm -f cards-combined.md cards-combined.apkg cards-combined.pdf
4456
cd rust && make clean
4557
cd godot && make clean
4658
cd sqlite && make clean

0 commit comments

Comments
 (0)