Skip to content

Commit

Permalink
release script
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Jan 14, 2021
1 parent 174433b commit 0065a6a
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 1 deletion.
22 changes: 22 additions & 0 deletions bindown-templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
templates:
eventbridge-pipe:
url: https://github.com/WillAbides/piper/releases/download/v{{.version}}/eventbridge-pipe_{{.version}}_{{.os}}_{{.arch}}.tar.gz
required_vars:
- version
systems:
- darwin/amd64
- linux/amd64
eventgrid-pipe:
url: https://github.com/WillAbides/piper/releases/download/v{{.version}}/eventgrid-pipe_{{.version}}_{{.os}}_{{.arch}}.tar.gz
required_vars:
- version
systems:
- darwin/amd64
- linux/amd64
splunk-pipe:
url: https://github.com/WillAbides/piper/releases/download/v{{.version}}/splunk-pipe_{{.version}}_{{.os}}_{{.arch}}.tar.gz
required_vars:
- version
systems:
- darwin/amd64
- linux/amd64
80 changes: 80 additions & 0 deletions bindown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ dependencies:
template: origin#goreleaser
vars:
version: 0.154.0
octo:
template: origin#octo
vars:
version: 0.23.0
shellcheck:
template: origin#shellcheck
vars:
version: 0.7.1
yq:
template: origin#yq
vars:
version: 3.4.1
templates:
origin#gobin:
url: https://github.com/myitcv/gobin/releases/download/v{{.version}}/{{.os}}-{{.arch}}
Expand Down Expand Up @@ -104,6 +112,36 @@ templates:
- linux/amd64
- windows/386
- windows/amd64
origin#octo:
url: https://github.com/octo-cli/octo-cli/releases/download/v{{.version}}/octo-cli_{{.version}}_{{.os}}_{{.arch}}.tar.gz
archive_path: octo{{.archivepathsuffix}}
bin: octo
vars:
archivepathsuffix: ""
required_vars:
- version
overrides:
- matcher:
os:
- windows
dependency:
vars:
archivepathsuffix: .exe
substitutions:
arch:
"386": i386
amd64: x86_64
os:
darwin: Darwin
linux: Linux
windows: Windows
systems:
- darwin/386
- darwin/amd64
- linux/386
- linux/amd64
- windows/386
- windows/amd64
origin#shellcheck:
url: https://github.com/koalaman/shellcheck/releases/download/v{{.version}}/shellcheck-v{{.version}}.{{.os}}.{{.arch}}.tar.xz
archive_path: shellcheck-v{{.version}}/shellcheck
Expand All @@ -124,6 +162,44 @@ templates:
- darwin/amd64
- linux/amd64
- windows/amd64
origin#yq:
url: https://github.com/mikefarah/yq/releases/download/{{.version}}/yq_{{.os}}_{{.arch}}{{.archivepathsuffix}}
archive_path: yq_{{.os}}_{{.arch}}{{.archivepathsuffix}}
bin: yq
vars:
archivepathsuffix: ""
required_vars:
- version
overrides:
- matcher:
os:
- windows
dependency:
vars:
archivepathsuffix: .exe
systems:
- darwin/386
- darwin/amd64
- freebsd/386
- freebsd/amd64
- freebsd/arm
- linux/386
- linux/amd64
- linux/arm
- linux/arm64
- linux/mips
- linux/mips64
- linux/mips64le
- linux/mipsle
- linux/ppc64
- linux/s390x
- netbsd/386
- netbsd/amd64
- netbsd/arm
- openbsd/386
- openbsd/amd64
- windows/386
- windows/amd64
template_sources:
origin: https://raw.githubusercontent.com/WillAbides/bindown-templates/master/bindown.yml
url_checksums:
Expand All @@ -133,5 +209,9 @@ url_checksums:
https://github.com/goreleaser/goreleaser/releases/download/v0.154.0/goreleaser_Linux_x86_64.tar.gz: 3f982da1c75bb274c7090c2d0d204cbe2820e07f40725676d46c82b87e200366
https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.darwin.x86_64.tar.xz: b080c3b659f7286e27004aa33759664d91e15ef2498ac709a452445d47e3ac23
https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz: 64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
https://github.com/mikefarah/yq/releases/download/3.4.1/yq_darwin_amd64: 5553d4640550debed5213a5eb6016d3a3485ca8a36e9c71996610280755d5a50
https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64: adbc6dd027607718ac74ceac15f74115ac1f3caef68babfb73246929d4ffb23c
https://github.com/myitcv/gobin/releases/download/v0.0.14/darwin-amd64: 08db3d50eea308b475d591d43efc160c7c44f4666da4f2fd103864a9d038b230
https://github.com/myitcv/gobin/releases/download/v0.0.14/linux-amd64: 5bc800e8be7eaefcb86780786c38b75243082685a17ceea3c2235e06b8259151
https://github.com/octo-cli/octo-cli/releases/download/v0.23.0/octo-cli_0.23.0_Darwin_x86_64.tar.gz: 1388c1ca5838a453055930035c81b231b829ef3b0511cc7765dffdd73b83d355
https://github.com/octo-cli/octo-cli/releases/download/v0.23.0/octo-cli_0.23.0_Linux_x86_64.tar.gz: 7bad6194d91bd9cd86a348dadafd7725b3bb4010afe36294df0740e8c815947a
2 changes: 1 addition & 1 deletion script/goreleaser
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

script/bindown install goreleaser 2>/dev/null
script/bindown install goreleaser > /dev/null
exec bin/goreleaser "$@"
8 changes: 8 additions & 0 deletions script/octo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

script/bindown install octo > /dev/null
exec bin/octo "$@"
41 changes: 41 additions & 0 deletions script/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

version="$1"

if [ -z "$version" ]; then
echo version is required >&2
exit 1
fi

if [[ $version == v* ]]; then
echo version cannot start with v >&2
exit 1
fi

tag="v$version"

mkdir -p ./tmp
script/yq w ./bindown-templates.yml 'templates.*.vars.version' "$version" >./tmp/bindown-templates.yml

release_id="$(
script/octo repos create-release \
--repo willabides/piper \
--tag_name "$tag" \
--name "$tag" \
--target_commitish "$(git rev-parse HEAD)" \
--format '{{.id | toJson}}'
)"

script/octo repos upload-release-asset \
--repo WillAbides/piper \
--release_id "$release_id" \
--file tmp/bindown-templates.yml \
--name bindown-templates.yml >/dev/null

git fetch origin "$tag"

script/goreleaser release --rm-dist
8 changes: 8 additions & 0 deletions script/yq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"

script/bindown install yq > /dev/null
exec bin/yq "$@"

0 comments on commit 0065a6a

Please sign in to comment.