Skip to content

Add more SQLite cards #16

Add more SQLite cards

Add more SQLite cards #16

name: Build Anki decks and upload artifacts
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
language:
- rust
- godot
- sqlite
- wolfram-language
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Nix Flake
run: nix flake check
- name: Make Hasklug font visible to tectonic
run: |
# nix develop realizes all dev-shell inputs into /nix/store
nix develop --command true
mkdir -p ~/Library/Fonts
for dir in /nix/store/*-nerd-fonts-hasklug-*/share/fonts; do
[ -d "$dir" ] || continue
find "$dir" -type f \( -name "*.otf" -o -name "*.ttf" \) \
-exec cp -n {} ~/Library/Fonts/ \;
done
echo "Installed fonts:"
ls ~/Library/Fonts/ | grep -i hasklug | head
- name: Build Anki deck and PDF with Nix
run: |
nix develop --command bash -c \
'cd ${{ matrix.language }} && make build'
- name: Rename artifacts
run: |
cp ${{ matrix.language }}/cards.apkg cards-${{ matrix.language }}.apkg
cp ${{ matrix.language }}/cards-with-name.apkg cards-${{ matrix.language }}-with-name.apkg
cp ${{ matrix.language }}/cards.pdf cards-${{ matrix.language }}.pdf
- name: Upload artifacts to workflow run
uses: actions/upload-artifact@v7
with:
name: cards-${{ matrix.language }}
path: |
cards-${{ matrix.language }}.apkg
cards-${{ matrix.language }}-with-name.apkg
cards-${{ matrix.language }}.pdf
if-no-files-found: error
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
cards-${{ matrix.language }}.apkg
cards-${{ matrix.language }}-with-name.apkg
cards-${{ matrix.language }}.pdf
combined:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Make Hasklug font visible to tectonic
run: |
nix develop --command true
mkdir -p ~/Library/Fonts
for dir in /nix/store/*-nerd-fonts-hasklug-*/share/fonts; do
[ -d "$dir" ] || continue
find "$dir" -type f \( -name "*.otf" -o -name "*.ttf" \) \
-exec cp -n {} ~/Library/Fonts/ \;
done
echo "Installed fonts:"
ls ~/Library/Fonts/ | grep -i hasklug | head
- name: Build combined Anki deck and PDF with Nix
run: |
nix develop --command bash -c 'make build-combined'
- name: Upload combined artifacts to workflow run
uses: actions/upload-artifact@v7
with:
name: cards-combined
path: |
cards-combined.apkg
cards-combined.pdf
if-no-files-found: error
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
cards-combined.apkg
cards-combined.pdf