~bduggan/raku-curlie

raku-curlie/make -rwxr-xr-x 925 bytes
30f9087fBrian Duggan remove version dependency of libcurl 1 year, 1 month ago
                                                                                
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
#!/usr/bin/env raku

if %*ENV<VERBOSE> {
  &shell.wrap: -> |c { say c.raku; callsame; }
  &QX.wrap: -> |c { say c.raku; callsame; }
}

my $module = 'Curlie';
my $version = q:x[jq -r .version META6.json].trim or exit note 'no version';

multi MAIN('test') {
  shell "TEST_AUTHOR=1 prove -e 'raku -Ilib' t/*";
}

multi MAIN('dist') {
  my $out = "tar/{$module}-{$version}.tar.gz";
  shell qq:to/SH/;
    echo "Making $version";
    mkdir -p tar
    git archive --prefix={$module}-{$version}/ -o $out {$version}
    SH
  say "wrote $out";
}

multi MAIN('bump') {
  my $next = qq:x[raku -e '"$version".split(".") >>+>> <0 0 1> ==> join(".") ==> say()'].trim;
  say "$version -> $next";
  exit note "no next version" unless $next;
  shell qq:to/SH/;
    perl -p -i -e "s/{$version}/{$next}/" META6.json
    perl -p -i -e "s/{$version}/{$next}/" lib/Curlie.rakumod
    SH
}

multi MAIN('clean') {
  shell 'rm -f dist/*.tar.gz';
}