Skip to content

Commit

Permalink
Add CI release support
Browse files Browse the repository at this point in the history
  • Loading branch information
wweir committed Jan 19, 2019
1 parent 8d0ee2a commit 8734486
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
32 changes: 27 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,38 @@ jobs:
- checkout # check out the code in the project directory
- setup_remote_docker # install docker in docker
- run:
name: build linux binary
name: Prepare Environment
command: |
cp conf/sower.toml .
cp deploy/* .
mkdir artifacts
- run:
name: build linux Binary
command: |
make build
mv sower sower.linux
tar czvf artifacts/sower-linux.tar.gz sower sower.toml
- run:
name: build macOS binary
name: build macOS Binary
command: |
GOOS=darwin GOARCH=amd64 make build
mv sower sower.darwin
tar czvf artifacts/sower-darwin.tar.gz sower sower.toml
- run:
name: build Windows Binary
command: |
GOOS=windows GOARCH=amd64 make build
tar czvf artifacts/sower-windows.tar.gz sower sower.toml
- run:
name: Publish Release on GitHub
command: |
go get github.com/tcnksm/ghr
VERSION=$(git describe --tags)
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION%-*-*} artifacts/
- run:
name: build docker image
command: |
make image
docker login -u $DOCKER_USER -p $DOCKER_PASS
make image
VERSION=$(git describe --tags)
docker tag sower:latest sower:${VERSION%-*-*}
docker push sower:${VERSION%-*-*}
docker push sower:latest
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# sower
[![CircleCI](https://circleci.com/gh/wweir/sower.svg?style=svg)](https://circleci.com/gh/wweir/sower)
Yet another cross platform transparent proxy tool

## architecture
Expand Down Expand Up @@ -46,6 +47,6 @@ http(s) proxy | +----------+ | |
## todo
- [x] authenticate
- [ ] broker
- [ ] CI/CD
- [x] CI/CD
- [ ] relay optimization
- [ ] deploy script for all normal platform
2 changes: 1 addition & 1 deletion shadow/cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func pickCipher(cipherType, password string) (cipher.AEAD, error) {
func genKey(filler string, size int) []byte {
res := make([]byte, size)
if filler == "" {
filler = "default_filler"
panic("password should not be empty")
}

fillerByte := []byte(filler)
Expand Down

0 comments on commit 8734486

Please sign in to comment.