Skip to content

Commit

Permalink
Handle tagging as part of release script
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccirello committed Nov 11, 2019
1 parent 5126d3b commit db2efda
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -2,4 +2,4 @@ build:
go build -o doppler main.go

release:
doppler run -- ./release.sh
doppler run -- ./release.sh $(VERSION)
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -41,12 +41,14 @@ Test building for all targets:

### Release

To release a new version, run:

```
git tag -a vX.Y.Z -m "The release message"
git push --tags
GITHUB_TOKEN=$(doppler secrets get GITHUB_TOKEN --plain) goreleaser release --rm-dist
make release VERSION=vX.Y.Z
```

This command will push local changes to Origin, create a new tag, and push the tag to Origin. It will then build and release the doppler binaries.

Note: The release will automatically fail if the tag and HEAD have diverged
` ⨯ release failed after 0.13s error=git tag v0.0.2 was not made against commit c9c6950d18790c17db11fedae331a226f8f12c6b`

Expand Down
18 changes: 17 additions & 1 deletion release.sh
@@ -1,10 +1,26 @@
#!/bin/bash

function finish {
rm "$GOOGLE_APPLICATION_CREDENTIALS"
rm -f "$GOOGLE_APPLICATION_CREDENTIALS"
}
trap finish EXIT

if [ $# -eq 0 ]; then
echo "You must specify a version"
exit 1
fi

TAGNAME=$1
if [ "${TAGNAME:0:1}" != "v" ]; then
echo "Version is incorrect; must match format vX.Y.Z"
exit 1
fi

echo "Using version $TAGNAME"

git tag -a "$TAGNAME" -m "$TAGNAME"
git push origin "$TAGNAME"

echo "$GOOGLE_CREDS" > "$GOOGLE_APPLICATION_CREDENTIALS"
goreleaser release --rm-dist
scripts/publish-deb.sh
Expand Down

0 comments on commit db2efda

Please sign in to comment.