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

Commit 881426b

Browse files
authored
Merge pull request #5 from gbevan/D20180828_prerel
preping with goreleaser
2 parents f3d213b + 29256ba commit 881426b

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.goreleaser.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This is an example goreleaser.yaml file with some sane defaults.
2+
# Make sure to check the documentation at http://goreleaser.com
3+
builds:
4+
- binary: gostint-client
5+
goos:
6+
- linux
7+
goarch:
8+
- amd64
9+
env:
10+
- CGO_ENABLED=0
11+
archive:
12+
replacements:
13+
#darwin: Darwin
14+
linux: Linux
15+
#windows: Windows
16+
#386: i386
17+
amd64: x86_64
18+
checksum:
19+
name_template: 'checksums.txt'
20+
snapshot:
21+
name_template: "{{ .Tag }}-SNAPSHOT-{{ .Commit }}"
22+
changelog:
23+
sort: asc
24+
filters:
25+
exclude:
26+
- '^docs:'
27+
- '^test:'
28+
release:
29+
github:
30+
owner: goethite
31+
name: gostint-client
32+
draft: false
33+
prerelease: true
34+
disable: false

release.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash -e
2+
#
3+
# Usage:
4+
# ./release.sh v1.0.0 "Comment for release"
5+
6+
TAG="$1"
7+
if [ "$TAG" == "" ]
8+
then
9+
echo "ERROR: You must specify a tag parameter, e.g. v1.0.0" >&2
10+
exit 1
11+
fi
12+
13+
COMMENT="$2"
14+
if [ "$COMMENT" == "" ]
15+
then
16+
echo "ERROR: You must specify a comment parameter" >&2
17+
exit 1
18+
fi
19+
20+
if [ "$GITHUB_TOKEN" == "" ]
21+
then
22+
echo "ERROR: You must set GITHUB_TOKEN to make a release" >&2
23+
exit 1
24+
fi
25+
26+
CURRENT_BRANCH=$(git branch | grep "^\*" | awk '{print $2;}')
27+
if [ "$CURRENT_BRANCH" != "master" ]
28+
then
29+
echo "ERROR: You must be on the master branch locally" >&2
30+
exit 1
31+
fi
32+
33+
# check clone has same commit point as upstream master
34+
git fetch upstream master
35+
36+
CLONE_MASTER_COMMIT=$(git show-ref refs/heads/master | awk '{print $1;}')
37+
UPSTREAM_MASTER_COMMIT=$(git ls-remote upstream master | awk '{print $1;}')
38+
39+
if [ "$CLONE_MASTER_COMMIT" != "$UPSTREAM_MASTER_COMMIT" ]
40+
then
41+
echo "ERROR: Your clone master must be at the same commit point as upstream master" >&2
42+
exit 1
43+
fi
44+
45+
echo "Tagging master as $TAG"
46+
git tag -a $TAG -m "$COMMENT"
47+
48+
echo "Pushing tag $TAG upstream"
49+
git push upstream $TAG
50+
51+
echo "Releasing to github..."
52+
goreleaser --rm-dist

0 commit comments

Comments
 (0)