-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
78 lines (67 loc) · 2.63 KB
/
justfile
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
#!/usr/bin/env just --justfile
name:='find-billy'
build_dir:='./build'
build_icons_dir:=build_dir+'/icons'
alpine_deps:='git xmlstarlet imagemagick inkscape'
nixpkgs_deps:='git xmlstarlet imagemagick inkscape'
version:='0.1.0'
# By default, recipes are only listed.
default:
@just --list
alpine-install-deps:
@apk add {{alpine_deps}}
alpine-uninstall-deps:
@apk del {{alpine_deps}}
non-nixos-install-deps:
#!/bin/sh
set -euxo pipefail
for package_name in {{nixpkgs_deps}}; do
nix-env -iA nixpkgs.$package_name
done
nixos-install-deps:
#!/bin/sh
set -euxo pipefail
for package_name in {{nixpkgs_deps}}; do
nix-env -iA nixos.$package_name
done
nix-uninstall-deps:
#!/bin/sh
set -euxo pipefail
for package_name in {{nixpkgs_deps}}; do
nix-env -e $package_name
done
# Generate several icon sizes and formats from one icon.
build-icons:
#!/bin/sh
set -euxo pipefail
# Clear {{build_icons_dir}}
mkdir -p {{build_icons_dir}}
rm -rf {{build_icons_dir}}
# Icons
for icon_width in 32 64 128 160 256 320 512; do
mkdir -p {{build_icons_dir}}/usr/share/icons/hicolor/$icon_width"x"$icon_width/apps
inkscape -o {{build_icons_dir}}/usr/share/icons/hicolor/$icon_width"x"$icon_width/apps/{{name}}.png -C -w $icon_width -h $icon_width --export-png-color-mode=RGBA_8 brand/icon.svg
done
convert {{build_icons_dir}}/usr/share/icons/hicolor/128x128/apps/{{name}}.png {{build_icons_dir}}/usr/share/icons/hicolor/128x128/apps/{{name}}.ico
convert {{build_icons_dir}}/usr/share/icons/hicolor/128x128/apps/{{name}}.png {{build_icons_dir}}/usr/share/icons/hicolor/128x128/apps/{{name}}.icns
changelog:
#!/bin/sh
set -euxo pipefail
# Generate changelog
git-chglog > CHANGELOG.md
# Git add
git add CHANGELOG.md
appdata-releases-update:
#!/bin/sh
set -euxo pipefail
# Update appdata <releases>
head -1 page.codeberg.papojari.Find_Billy.appdata.xml > page.codeberg.papojari.Find_Billy.appdata.xml.tmp
xmlstarlet edit --omit-decl -s '//releases' -t elem -n "release" -s '//releases/release[last()]' -t elem -n "url" -v "https://codeberg.org/papojari/Find-Billy/releases/tag/v{{version}}" -s '//releases/release[last()]' -t attr -n "version" -v "v{{version}}" -s '//releases/release[last()]' -t attr -n "date" -v "$(date -u +'%Y-%m-%d')" page.codeberg.papojari.Find_Billy.appdata.xml >> page.codeberg.papojari.Find_Billy.appdata.xml.tmp
mv page.codeberg.papojari.Find_Billy.appdata.xml.tmp page.codeberg.papojari.Find_Billy.appdata.xml
# Git add
git add page.codeberg.papojari.Find_Billy.appdata.xml
release: changelog appdata-releases-update
#!/bin/sh
set -euxo pipefail
git commit -m "release: v{{version}}"
git tag -a -m "version {{version}}" "v{{version}}"