Skip to content

Commit ef3c16a

Browse files
committed
Finish releaser
1 parent 6a282a0 commit ef3c16a

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install:
2626
update-vendor:
2727
cd cmd/nash && nash ./vendor.sh
2828

29-
release:
29+
release: clean
3030
./hack/releaser.sh $(version)
3131

3232
clean:

hack/releaser.sh

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ if len($ARGS) != "2" {
55
exit("1")
66
}
77

8-
version = $ARGS[1]
9-
supported_os = ("linux" "darwin" "windows")
8+
version = $ARGS[1]
9+
supported_os = ("linux" "darwin" "windows")
10+
supported_arch = ("amd64")
1011

1112
# Guarantee passing tests at least on the host arch/os
1213
make test
@@ -15,31 +16,42 @@ setenv CGO_ENABLED = "0"
1516

1617
mkdir -p dist
1718

18-
fn copy_exec(src, dst) {
19+
fn prepare_execs(distfiles, os) {
1920
if $os == "windows" {
20-
src = $src+".exe"
21-
dst = $dst+".exe"
21+
newfiles = ()
22+
23+
for distfile in $distfiles {
24+
file = $distfile+".exe"
25+
26+
newfiles <= append($newfiles, $file)
27+
}
28+
29+
return $newfiles
30+
}
31+
if $os == "linux" {
32+
for distfile in $distfiles {
33+
strip $distfile
34+
}
2235
}
2336

24-
cp $src $dst
37+
return $distfiles
2538
}
2639

2740
for os in $supported_os {
28-
setenv GOOS = $os
29-
setenv GOARCH = "amd64"
30-
31-
echo "building OS: "+$GOOS+" ARCH : "+$GOARCH
32-
make build "version="+$version
33-
34-
source_nash = "cmd/nash/nash"
41+
for arch in $supported_arch {
42+
setenv GOOS = $os
43+
setenv GOARCH = $arch
3544

36-
target_nash <= format("dist/nash-%s-%s-amd64", $version, $os)
45+
echo "building OS: "+$GOOS+" ARCH : "+$GOARCH
46+
make build "version="+$version
3747

38-
copy_exec($source_nash, $target_nash)
48+
nash = "cmd/nash/nash"
49+
nashfmt = "cmd/nashfmt/nashfmt"
50+
execfiles = ($nash $nashfmt)
3951

40-
source_nashfmt = "cmd/nashfmt/nashfmt"
52+
distfiles <= prepare_execs($execfiles, $os)
53+
distar <= format("dist/nash-%s-%s-%s.tar.gz", $version, $os, $arch)
4154

42-
target_nashfmt <= format("dist/nashfmt-%s-%s-amd64", $version, $os)
43-
44-
copy_exec($source_nashfmt, $target_nashfmt)
55+
tar cvfz $distar $distfiles
56+
}
4557
}

0 commit comments

Comments
 (0)