Skip to content

Commit

Permalink
Adds arm builds with goreleaser (#8)
Browse files Browse the repository at this point in the history
* Adds arm builds with goreleaser
* Fix regex
* Finish readme
  • Loading branch information
kimpepper committed Jan 5, 2022
1 parent 6907b5f commit 5faca12
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 12 deletions.
28 changes: 17 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
version: 2.1

workflows:
test:
build:
jobs: [ build ]
release:
jobs:
- lint
- unit

- release:
context: org-global
filters:
branches:
ignore: /.*/
tags:
# Only on tags formatted like v0.1.1
only: /^v\d+\.\d+\.\d+[\-a-z0-9]*$/
jobs:
lint:
build:
docker:
- image: golang:1.14
- image: golang:1.16
working_directory: /go/src/github.com/skpr/mail
steps:
- checkout
- run: |
go get golang.org/x/lint/golint
make lint
unit:
- run: make test
release:
docker:
- image: golang:1.13
working_directory: /go/src/github.com/skpr/mail
- image: docker.io/goreleaser/goreleaser:latest
steps:
- checkout
- run: make test
- run: goreleaser
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.DS_Store
/bin
/dist
18 changes: 18 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Documentation at http://goreleaser.com

builds:
- binary: skprmail
env: [ CGO_ENABLED=0 ]
goos: [ linux, darwin ]
goarch: [ amd64, arm64 ]

archives:
- replacements:
darwin: macOS
format: binary

release:
prerelease: auto
github:
owner: skpr
name: mail
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine:3.15

RUN apk add --no-cache ca-certificates

COPY skprmail /usr/local/bin/
RUN chmod +x /usr/local/bin/skprmail

CMD ["/usr/local/bin/skprmail"]
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,20 @@ export SKPRMAIL_AWS_REGION=us-east-1
export SKPRMAIL_FROM_ADDRESS=admin@previousnext.com.au
$ cat /tmp/test-email.txt | skprmail
```


### Releasing

Testing a release:

```
goreleaser release --rm-dist --snapshot --skip-publish
```
Releasing:
```
golreleaser
```

0 comments on commit 5faca12

Please sign in to comment.