Skip to content

Commit

Permalink
Add goreleaser (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirks authored Feb 1, 2021
1 parent c0b5142 commit 2d360bc
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 13 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/actions.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: CI
name: Build

on:
push:

env:
SSMSH_VERSION: 1.4.3
AWS_DEFAULT_REGION: us-east-1

jobs:
Expand All @@ -15,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.13
go-version: 1.15
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
Expand All @@ -28,7 +27,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.13
go-version: 1.15
- name: Vet
run: go vet -v $(go list ./...)
- name: Test
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
before:
hooks:
- go mod download

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
ldflags:
- -s -w -X main.Version={{.Version}}

archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- none*

changelog:
sort: asc

brews:
- tap:
owner: bwhaley
name: ssmsh
description: A shell for the EC2 Parameter Store
homepage: https://github.com/bwhaley/ssmsh
license: MIT
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)

VERSION := $(shell echo ${SSMSH_VERSION})
ifeq "$(VERSION)" ""
$(error must define SSMSH_VERSION env var)
VERSION="auto-build"
endif

GOVERSION := $(shell go version | grep 1.13)
GOVERSION := $(shell go version | grep 1.15)
ifeq "$(GOVERSION)" ""
$(error must be running Go version 1.13.x)
$(error must be running Go version 1.15.x)
endif

ifndef $(GOPATH)
Expand Down
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,33 @@ ssmsh is an interactive shell for the EC2 Parameter Store. Features:
* Submit batch commands with the `-file` flag
* Inline commands


## Installation

1. Download [here](https://github.com/bwhaley/ssmsh/releases) or clone and build from this repo.
2. Set up [AWS credentials](http://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials).
### Binaries

Download binaries for MacOS, Linux, or Windows from the latest release [here](https://github.com/bwhaley/ssmsh/releases).

### Homebrew

There is a Homebrew tap published to this repo, for installation on both MacOS and Linux. Add the tap and install with:

```bash
brew tap bwhaley/ssmsh https://github.com/bwhaley/ssmsh
brew install ssmsh
```

### Nix

There is also [a Nix package](https://search.nixos.org/packages?channel=unstable&show=ssmsh&query=ssmsh) available for MacOS and Linux:

```bash
nix-env -i ssmsh
```

## Configuration

Set up [AWS credentials](http://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials).

You can set up a `.ssmshrc` to configure `ssmsh`. By default, `ssmsh` will load `~/.ssmshrc` if it exists. Use the `-config` argument to set a different path.

```bash
Expand Down Expand Up @@ -260,10 +279,10 @@ $ ssmsh put name=/dev/app/domain value="www.example.com" type=String description
MIT

## Contributing/compiling
1. Ensure you have at least go v1.13
1. Ensure you have at least go v1.15
```
$ go version
go version go1.13.8 darwin/amd64
go version go1.15.7 darwin/amd64
```
2. Ensure your `$GOPATH` exists and is in your `$PATH`
```
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/bwhaley/ssmsh

go 1.13
go 1.15

require (
github.com/abiosoft/ishell v2.0.1-0.20181228190644-8b8aa74a8512+incompatible
Expand Down

0 comments on commit 2d360bc

Please sign in to comment.