Skip to content

Commit

Permalink
Merge pull request #19 from 99designs/add-release-instructions
Browse files Browse the repository at this point in the history
Build arm64 binaries and Docker container and add release instructions
  • Loading branch information
Eddy Nguyen authored Jan 10, 2022
2 parents 1862548 + b2f8b7c commit f3c72fb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@ export GO111MODULE=on
VERSION=$(shell git describe --tags --candidates=1 --dirty)
FLAGS=-X main.Version=$(VERSION) -s -w

# To create a new release:
# $ git tag vx.x.x
# $ git push --tags
# $ make clean
# $ make release # this will create 3 binaries in ./bin
#
# Next, go to https://github.com/99designs/smartling/releases/new
# - select the tag version you just created
# - Attach the binaries from ./bin/*

release: bin/smartling-linux-amd64 bin/smartling-darwin-amd64 bin/smartling-windows-386.exe
release: bin/smartling-linux-amd64 bin/smartling-darwin-amd64 bin/smartling-linux-arm64 bin/smartling-darwin-arm64 bin/smartling-windows-386.exe

bin/smartling-linux-amd64:
@mkdir -p bin
Expand All @@ -26,5 +16,13 @@ bin/smartling-windows-386.exe:
@mkdir -p bin
GOOS=windows GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" .

bin/smartling-linux-arm64:
@mkdir -p bin
GOOS=linux GOARCH=arm64 go build -o $@ -ldflags="$(FLAGS)" .

bin/smartling-darwin-arm64:
@mkdir -p bin
GOOS=darwin GOARCH=arm64 go build -o $@ -ldflags="$(FLAGS)" .

clean:
rm -f bin/*
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,39 @@ parser_config: # Add a custom confi
placeholder_format_custom: "%[^%]+%"
pull_file_path: "{{ TrimSuffix .Path .Ext }}.{{.Locale}}{{.Ext}}" # The naming scheme when pulling files
```
### How to make a release
1. Check out the the commit you want to create a release for, and tag it with appropriate semver convention:
```
$ git tag vx.x.x
$ git push --tags
```

2. Create the binaries:

```
$ make clean
$ make release
```

3. Go to https://github.com/99designs/smartling/releases/new

4. Select the tag version you just created

5. Attach the binaries from `./bin/*`

### How to build multi-arch DockerHub image

If building a multi-arch image for the first time, you may need to switch your builder. Checkout Docker guide on [building multi-arch images](https://docs.docker.com/desktop/multi-arch/#build-multi-arch-images-with-buildx)

```
$ docker buildx create --use
```

Build and push to target repository

```
$ docker buildx build --push --tag 99designs/smartling:x.x.x --platform linux/amd64,linux/arm64 .
```

0 comments on commit f3c72fb

Please sign in to comment.