music/Justfile

28 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

2023-12-26 21:29:36 +00:00
datetime := `date +%Y-%m-%d_%H%M%S_%Z`
tmp := `mktemp -d`
default: guitar piano
guitar: dirs
fd '.cho' -t f -x chordpro -o ~/Documents/Music/{.}.pdf {}
piano: dirs
fd '.ly' -t f -x lilypond -o ~/Documents/Music/{.} {}
dirs:
fd . -t d -x mkdir -p ~/Documents/Music/{}
release: default
tar -C ~/Documents/Music -cf {{tmp}}/music.tar Guitar
tar -C ~/Documents/Music -rf {{tmp}}/music.tar Piano
gzip {{tmp}}/music.tar
ssh-keygen -Y sign -f ~/.ssh/yk-stationary -n file {{tmp}}/music.tar.gz
cd {{tmp}} && sha256sum music.tar.gz > music.tar.gz.sha256 && cd -
cd ~/Documents/Music && zip -r {{tmp}}/music.zip Guitar Piano && cd -
ssh-keygen -Y sign -f ~/.ssh/yk-stationary -n file {{tmp}}/music.zip
cd {{tmp}} && sha256sum music.zip > music.zip.sha256 && cd -
git tag -s -m {{datetime}} {{datetime}}
git push --tags
tea r create -a {{tmp}}/music.tar.gz -a {{tmp}}/music.tar.gz.sig -a {{tmp}}/music.tar.gz.sha256 -a {{tmp}}/music.zip -a {{tmp}}/music.zip.sig -a {{tmp}}/music.zip.sha256 --tag {{datetime}} -t {{datetime}}
rm -rf {{tmp}}