aboutsummarylogtreecommitdiffstats
path: root/justfile
blob: 80985c065efd15b69f9d239c3c47dc16a543bd11 (plain)
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
pkgbase:="dashlane-cli-git"

default: publish

build:
    @makepkg

rebuild:
    @makepkg -f

nobuild:
    @makepkg -o

delete-src:
    @rm -rf src || true

delete-pkg:
    @rm -rf pkg || true

delete-build-packages:
    @rm -f *.pkg.tar.zst || true

delete-all: delete-build-packages delete-src delete-pkg

cleanbuild: delete-all
    @makepkg -C

srcinfo:
    @makepkg --printsrcinfo > .SRCINFO

checksum:
    @updpkgsums

install:
    @sudo pacman -U *.pkg.tar.zst --noconfirm

uninstall:
    @sudo pacman -Rss {{ pkgbase }} --noconfirm

src-version:
    @cd src/{{ pkgbase }} && git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'

prepare: rebuild checksum srcinfo

publish: prepare
    echo "New version: $(just src-version)"
    @git add .
    echo "Committing and tagging..."
    @git commit -m "Update to $(just src-version)"
    @git tag -a $(just src-version) -m "Release $(shell make src-version)"
    echo "Pushing to origin..."
    @git push
    @git push --tags
    echo "Pushing to aur..."
    @git push aur master
    @git push --tags aur master

test-local: rebuild
    ./src/{{ pkgbase }}/bundle/dcli-linux --version

test: prepare install && uninstall
    @dcli --version

remote-add-aur:
    git remote add aur ssh://aur@aur.archlinux.org/{{ pkgbase }}.git