Skip to content

Commit

Permalink
run goreleaser as part of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yannh committed Jun 22, 2020
1 parent 63c7167 commit 7dd46cf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: build
name: ci
on: push
jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -10,5 +10,15 @@ jobs:
- name: test
run: make docker-test

- name: build
run: make docker-build-static
goreleaser:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: checkout
uses: actions/checkout@v2

- name: goreleaser
run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
builds:
- env:
- CGO_ENABLED=0
- GOFLAGS = -mod=vendor
- GO111MODULE = on
goos:
- windows
- linux
- darwin
flags:
- -trimpath
- -tags=netgo
- -a
ldflags:
- -extldflags "-static"
archives:
- format: tar.gz
format_overrides:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ docker-test:
docker run -t -v $$PWD:/go/src/github.com/yannh/redis-dump-go -w /go/src/github.com/yannh/redis-dump-go golang:1.14 make test

docker-build-static:
docker run -t -v $$PWD:/go/src/github.com/yannh/redis-dump-go -w /go/src/github.com/yannh/redis-dump-go golang:1.14 make build-static
docker run -t -v $$PWD:/go/src/github.com/yannh/redis-dump-go -w /go/src/github.com/yannh/redis-dump-go golang:1.14 make build-static

release:
docker run -e GITHUB_TOKEN -t -v $$PWD:/go/src/github.com/yannh/redis-dump-go -w /go/src/github.com/yannh/redis-dump-go goreleaser/goreleaser:v0.138 goreleaser release --rm-dist
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Dump Redis keys to a file. Similar in spirit to https://www.npmjs.com/package/redis-dump and https://github.com/delano/redis-dump but:

* Will dump keys across several processes & connections
* Uses SCAN rather than KEYS * for much reduced memory footprint with large databases
* Easy to deploy & containerize - single binary.
* Generates a [RESP](https://redis.io/topics/protocol) file rather than a JSON or a list of commands. This is faster to ingest, and [recommended by Redis](https://redis.io/topics/mass-insert) for mass-inserts.
* Will dump keys across **several processes & connections**
* Uses SCAN rather than KEYS * for much **reduced memory footprint** with large databases
* Easy to deploy & containerize - **single binary**.
* Generates a [RESP](https://redis.io/topics/protocol) file rather than a JSON or a list of commands. This is **faster to ingest**, and [recommended by Redis](https://redis.io/topics/mass-insert) for mass-inserts.

Warning: like similar tools, Redis-dump-go does NOT provide Point-in-Time backups. Please use [Redis backups methods](https://redis.io/topics/persistence) when possible.

Expand Down

0 comments on commit 7dd46cf

Please sign in to comment.