Skip to content

Commit

Permalink
Adds scripts to publish releases
Browse files Browse the repository at this point in the history
  • Loading branch information
radiospiel committed Jan 6, 2020
1 parent 41deb4c commit 05396f6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ build-golang-all:
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/envy.x86_64-pc-linux-gnu.bin src/golang/main.go
upx bin/envy.x86_64-pc-linux-gnu.bin

prerelease: build-golang-all
scripts/prerelease

release: build-golang-all
scripts/release

# --- ruby specific -----------------------------------------------------------

test-ruby:
Expand Down
19 changes: 19 additions & 0 deletions scripts/prerelease
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -eu -o pipefail

DATE=$(date "+%y%m%d-%H%M%S")

# RELEASE_TYPE=""
# RELEASE_TYPE="--draft"
RELEASE_TYPE="--prerelease"

# prepare release.md text file
erb date=$DATE $0.md.erb > tmp/release.md

hub release create $RELEASE_TYPE \
--attach "bin/envy.x86_64-pc-linux-gnu.bin#linux binary" \
--attach "bin/envy.x86_64-apple-darwin18.bin#macos binary" \
--file tmp/release.md \
--edit \
--commitish purpose/add-go \
releases/$DATE
8 changes: 8 additions & 0 deletions scripts/prerelease.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%= "Prerelease #{date}" %>

This is a prerelease. Handle with care!

To use it either:

- download the binary for your platform and rename it to "envy", or
- download the source and run `make install`.
19 changes: 19 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -eu -o pipefail

DATE=$(date "+%y%m%d-%H%M%S")

# RELEASE_TYPE=""
# RELEASE_TYPE="--draft"
RELEASE_TYPE="--prerelease"

# prepare release.md text file
erb date=$DATE $0.md.erb > tmp/release.md

hub release create $RELEASE_TYPE \
--attach "bin/envy.x86_64-pc-linux-gnu.bin#linux binary" \
--attach "bin/envy.x86_64-apple-darwin18.bin#macos binary" \
--file tmp/release.md \
--edit \
--commitish purpose/add-go \
releases/$DATE
6 changes: 6 additions & 0 deletions scripts/release.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<%= "Release #{date}" %>

This is a release. To use it either:

- download the binary for your platform and rename it to "envy", or
- download the source and run `make install`.

0 comments on commit 05396f6

Please sign in to comment.