summarylogtreecommitdiffstats
path: root/release.fish
blob: b161e46b1969d17e704cb6418ae90669a49a7a6d (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
#!/usr/bin/env fish

set stripe_cli_version $argv[1]

echo "Making a new release of stripe-cli $stripe_cli_version"

echo "Getting checksum..."
set checksum (curl -L https://github.com/stripe/stripe-cli/releases/download/v$stripe_cli_version/stripe-linux-checksums.txt | grep linux_x86_64.tar.gz | awk '{print $1}')

echo "Building PKGBUILD..."
sed "s/VERSION/$stripe_cli_version/g;s/CHECKSUM/$checksum/g" PKGBUILD.template >PKGBUILD

echo "Making and installing package locally..."
makepkg -i; or exit

echo "Generating .SRCINFO..."
makepkg --printsrcinfo >.SRCINFO

echo "Testing that the new version works with stripe -v..."
if not stripe -v
    echo "Failed to run stripe!"
    exit 1
end

read -p 'echo "Ready to commit/push? [Y/n] "' ok
if test $ok = "y" -o $ok = ""
    echo "Committing to git..."
    git commit -am "Release of $stripe_cli_version"

    echo "Pushing..."
    git push origin master
    git push aur master
else
    echo "Exiting without pushing!"
    exit 1
end