Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 7dc46af

Browse files
authored
Merge pull request #19 from cdr/release-build
Simple release builder
2 parents f7d230b + 84c014f commit 7dc46af

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea
2+
ci/bin

ci/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
cd "$(dirname "$0")"
5+
6+
export GOARCH=amd64
7+
tag=$(git describe --tags)
8+
9+
mkdir -p bin
10+
11+
build(){
12+
tmpdir=$(mktemp -d)
13+
go build -ldflags "-X main.version=${tag}" -o "$tmpdir/coder-cli"
14+
15+
pushd "$tmpdir"
16+
tarname="coder-cli-$GOOS-$GOARCH.tar.gz"
17+
tar -czf "$tarname" coder-cli
18+
popd
19+
20+
cp "$tmpdir/$tarname" bin
21+
rm -rf "$tmpdir"
22+
}
23+
24+
GOOS=darwin build
25+
GOOS=linux build

0 commit comments

Comments
 (0)