Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare v0.4.0 #13

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 11 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,50 @@ jobs:
build:
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
go-version: [1.16.x]
platform: [ubuntu-latest, macos-latest]
name: build
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- run: go build
lint:
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
go-version: [1.16.x]
platform: [ubuntu-latest]
name: lint
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
go get -u golang.org/x/lint/golint
- run: |
go install golang.org/x/lint/golint@v0.0.0-20201208152925-83fdc39ff7b5
golint -set_exit_status ./...
go vet ./...
tests:
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
go-version: [1.16.x]
platform: [ubuntu-latest, macos-latest]
name: tests
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- run: |
go get -u github.com/mfridman/tparse
go test -v -race -cover -json ./... | $(go env GOPATH)/bin/tparse -all
docker:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest]
name: docker
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- run: |
docker build -t psampaz/gothanks .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
dist
gothanks
38 changes: 38 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
builds:
-
ldflags:
-s -w
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
-
goos: linux
goarch: amd64
image_templates:
- "psampaz/gothanks:latest"
- "psampaz/gothanks:{{ .Tag }}"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [v0.4.0] - 2021-03-01
### Added
- GoReleaser

## [v0.3.0] - 2020-04-12
### Added
- Run gothanks using docker
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM golang:1.14.2-alpine3.11
FROM golang:1.16.0-alpine3.13
RUN apk update
RUN apk add --no-cache git
RUN apk --update add ca-certificates
WORKDIR /home
COPY ./ .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o gothanks .

FROM scratch
WORKDIR /home/
COPY --from=0 /home/gothanks /usr/bin/
COPY gothanks /usr/bin/
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["gothanks"]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gorelease-dry:
goreleaser --snapshot --skip-publish --rm-dist
gorelease:
goreleaser release