Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit e733b34

Browse files
authored
Merge pull request #25 from keybase/david/automated-github-releases
Automated github releases after merge
2 parents c9be4a5 + e7c00a4 commit e733b34

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

.circleci/config.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,29 @@ jobs:
2626
- run: "! go mod tidy ./... 2>&1 | read"
2727
- run: go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1
2828
- run: "! golangci-lint 2>&1 | read"
29+
publish-github-release:
30+
docker:
31+
- image: circleci/golang:1.11
32+
steps:
33+
- checkout
34+
- run: ./buildAll.sh
35+
- run:
36+
command: |
37+
go get github.com/tcnksm/ghr
38+
export VERSION=`cat VERSION`-`git rev-parse --short HEAD`
39+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./bin/
2940
workflows:
3041
version: 2
3142
build:
3243
jobs:
3344
- integration
3445
- unit
3546
- lint
36-
47+
- publish-github-release:
48+
requires:
49+
- integration
50+
- unit
51+
- lint
52+
filters:
53+
branches:
54+
only: master

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ Now on the server where you wish to run the chatbot, start the chatbot itself:
7070
make serve # Runs inside of docker for ease of use
7171
```
7272

73-
Now build the kssh binary and start SSHing!
73+
Now download the kssh binary and start SSHing! See https://github.com/keybase/bot-sshca/releases to download the most
74+
recent version of kssh for your platform.
7475

7576
```bash
76-
go build -o bin/kssh src/cmd/kssh/kssh.go
77-
sudo cp bin/kssh /usr/local/bin/ # Optional but recommended
77+
sudo mv kssh-{platform} /usr/local/bin/kssh
78+
sudo chmod +x /usr/local/bin/kssh
79+
7880
kssh developer@staging-server-ip # If in {TEAM}.ssh.staging
7981
kssh developer@production-server-ip # If in {TEAM}.ssh.production
8082
kssh root@server # If in {TEAM}.ssh.root_everywhere

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

buildAll.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
export VERSION="`cat VERSION`-`git rev-parse --short HEAD`"
4+
5+
# Linux
6+
go build -ldflags "-X main.VersionNumber=$VERSION" -o bin/kssh-linux src/cmd/kssh/kssh.go
7+
go build -ldflags "-X main.VersionNumber=$VERSION" -o bin/keybaseca-linux src/cmd/keybaseca/keybaseca.go
8+
9+
# Mac
10+
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.VersionNumber=$VERSION" -o bin/kssh-mac src/cmd/kssh/kssh.go
11+
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.VersionNumber=$VERSION" -o bin/keybaseca-mac src/cmd/keybaseca/keybaseca.go
12+
13+
# Windows
14+
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.VersionNumber=$VERSION" -o bin/kssh-windows src/cmd/kssh/kssh.go
15+
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.VersionNumber=$VERSION" -o bin/keybaseca-windows src/cmd/keybaseca/keybaseca.go

src/cmd/keybaseca/keybaseca.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ import (
2626
"github.com/urfave/cli"
2727
)
2828

29+
var VersionNumber = "master"
30+
2931
func main() {
3032
app := cli.NewApp()
3133
app.Name = "keybaseca"
3234
app.Usage = "An SSH CA built on top of Keybase"
33-
app.Version = "0.0.1"
35+
app.Version = VersionNumber
3436
app.Flags = []cli.Flag{
3537
cli.BoolFlag{
3638
Name: "wipe-all-configs",

src/cmd/kssh/kssh.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ var cliArguments = []kssh.CLIArgument{
106106
{Name: "--set-keybase-binary", HasArgument: true},
107107
}
108108

109+
var VersionNumber = "master"
110+
109111
func generateHelpPage() string {
110112
return fmt.Sprintf(`NAME:
111113
kssh - A replacement ssh binary using Keybase SSH CA to provision SSH keys
@@ -114,7 +116,7 @@ USAGE:
114116
kssh [kssh options] [ssh arguments...]
115117
116118
VERSION:
117-
0.0.1
119+
%s
118120
119121
GLOBAL OPTIONS:
120122
--help Show help
@@ -129,7 +131,7 @@ GLOBAL OPTIONS:
129131
--set-default-user Set the default SSH user to be used for kssh. Useful if you use ssh configs that do not set
130132
a default SSH user
131133
--clear-default-user Clear the default SSH user
132-
--set-keybase-binary Run kssh with a specific keybase binary rather than resolving via $PATH `)
134+
--set-keybase-binary Run kssh with a specific keybase binary rather than resolving via $PATH `, VersionNumber)
133135
}
134136

135137
type Action int

0 commit comments

Comments
 (0)