master
 1$.verbose = true
 2
 3const goos = [
 4  'linux',
 5  'darwin',
 6  'windows',
 7]
 8const goarch = [
 9  'amd64',
10  'arm64',
11]
12
13const name = (GOOS, GOARCH) => `gitmal_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
14
15const resp = await fetch('https://api.github.com/repos/antonmedv/gitmal/releases/latest')
16const {tag_name: latest} = await resp.json()
17
18await $`go mod download`
19
20await Promise.all(
21  goos.flatMap(GOOS =>
22    goarch.map(GOARCH =>
23      $`GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${name(GOOS, GOARCH)}`)))
24
25await Promise.all(
26  goos.flatMap(GOOS =>
27    goarch.map(GOARCH =>
28      $`gh release upload ${latest} ${name(GOOS, GOARCH)}`)))
29
30await Promise.all(
31  goos.flatMap(GOOS =>
32    goarch.map(GOARCH =>
33      $`rm ${name(GOOS, GOARCH)}`)))