-
Notifications
You must be signed in to change notification settings - Fork 4
/
.build.yml
55 lines (50 loc) · 1.45 KB
/
.build.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
image: alpine/edge
oauth: git.sr.ht/OBJECTS:RW git.sr.ht/REPOSITORIES:RW git.sr.ht/PROFILE:RO
packages:
- git
- go
- make
- musl-dev
- scdoc
- hut
sources:
- https://git.sr.ht/~gpanders/ijq
environment:
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
triggers:
- action: email
condition: failure
to: Gregory Anders <[email protected]>
tasks:
- setup: |
echo 'cd ijq' >> ~/.buildenv
- test: |
make test
- update-readme: |
hut git update --readme README.srht.html
- nopr: |
# Don't run on GitHub PRs
[ "$BUILD_SUBMITTER" = 'git.sr.ht' ] || complete-build
- build: |
tag=$(git describe --exact-match 2>/dev/null || true)
if [ -z "$tag" ]; then
echo "Current commit is not a tag; not building anything"
exit 0
fi
version=$(echo "$tag" | tr -d 'v')
mkdir ijq-"$version"
build() {
os="$1"
arch="$2"
make GOOS="$os" GOARCH="$arch" clean all
cp ijq ijq.1 COPYING ijq-"$version"/
if [ "$os" = windows ]; then
mv ijq-"$version"/ijq{,.exe}
fi
tar czf ijq-"$version"-"$os"-"$arch".tar.gz ijq-"$version"
hut git artifact upload --rev "$tag" ijq-"$version"-"$os"-"$arch".tar.gz
}
build darwin amd64
build darwin arm64
build linux amd64
build windows amd64