Skip to content

Commit

Permalink
Added goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
yarlson committed Nov 25, 2019
1 parent ee388ad commit 4604fd6
Show file tree
Hide file tree
Showing 6 changed files with 477 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ test/

# config file
config.*
dist/
55 changes: 55 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
builds:
- env:
- CGO_ENABLED=0
binary:
lokalise2
goos:
- darwin
- windows
- linux
- freebsd
goarch:
- 386
- amd64
- arm
- arm64
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
freebsd: FreeBSD
386: i386
amd64: x86_64

dockers:
- goos: linux
binaries:
- lokalise2
image_templates:
- "lokalise/lokalise-cli-2:latest"
- "lokalise/lokalise-cli-2:{{ .Tag }}"
skip_push: true
dockerfile: Dockerfile

brews:
- github:
owner: lokalise
name: homebrew-cli-2
folder: Formula
homepage: "https://docs.lokalise.com/cli2"
description: "Lokalise CLI v2"
skip_upload: true

checksum:
name_template: 'checksums.txt'

changelog:
sort: asc
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:latest as certs
RUN apk --update add ca-certificates

FROM scratch
ENV PATH=/bin
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY lokalise2 /bin/lokalise2
18 changes: 4 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
# defining variables
GO ?= go
BINARY := lokalise2
GIT_REV := $$(git rev-parse HEAD)
PLATFORMS=darwin linux windows freebsd
ARCHITECTURES=386 amd64

run: build
$(info running...)
bin/$(BINARY)
.PHONY: run

build_all:
$(foreach GOOS, $(PLATFORMS), \
$(foreach GOARCH, $(ARCHITECTURES), \
$(shell \
export GOOS=$(GOOS); \
export GOARCH=$(GOARCH); \
EXT=""; \
if [ ${GOOS} == "windows" ]; then EXT=".exe"; fi; \
go build -v -o bin/$(BINARY)$$EXT; \
tar -C bin/ -cf dist/lokalise2-${VERSION}-${GOOS}-${GOARCH}.tgz $(BINARY)$$EXT)))
release:
goreleaser release
.PHONY: release

build: clean
$(info building...)
Expand All @@ -29,4 +18,5 @@ build: clean
clean:
$(info cleaning...)
rm -rf ./bin/*
rm -rf ./dist/*
.PHONY: clean
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,15 @@ Get the binaries for your platform, unarchive and put into any executable folder

### MacOS
Install using Homebrew:
```
```console
brew tap lokalise/cli-2
brew install lokalise2
```
or get the binaries:
- [lokalise2-2.03-darwin-amd64.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-darwin-amd64.tgz)
- [lokalise2-2.03-darwin-386.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-darwin-386.tgz)

### Linux
- [lokalise2-2.03-linux-amd64.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-linux-amd64.tgz)
- [lokalise2-2.03-linux-386.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-linux-386.tgz)

### FreeBSD
- [lokalise2-2.03-freebsd-amd64.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-freebsd-amd64.tgz)
- [lokalise2-2.03-freebsd-386.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-freebsd-386.tgz)

### Windows
- [lokalise2-2.03-windows-amd64.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-windows-amd64.tgz)
- [lokalise2-2.03-windows-386.tgz](https://s3-eu-west-1.amazonaws.com/lokalise-assets/cli2/lokalise2-2.03-windows-386.tgz)
### Linux (including Raspberry Pi)
Get the binaries using our installer script:
```console
curl -sfL https://raw.githubusercontent.com/lokalise/lokalise-cli-2-go/master/install.sh | sh
```

### Docker
See [DockerHub](https://hub.docker.com/r/lokalise/lokalise-cli-2) for more information.
Expand Down
Loading

0 comments on commit 4604fd6

Please sign in to comment.