Add GoReleaser config
This commit is contained in:
parent
2fc430dda1
commit
6c5591c969
6 changed files with 51 additions and 4 deletions
34
.github/workflows/release.yml
vendored
Normal file
34
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify:
|
||||||
|
name: Verify
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.16
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Lint code
|
||||||
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
with:
|
||||||
|
args: release --rm-dist
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins
|
||||||
bin/
|
bin/
|
||||||
|
dist/
|
||||||
*.exe
|
*.exe
|
||||||
*.exe~
|
*.exe~
|
||||||
*.dll
|
*.dll
|
||||||
|
|
12
.goreleaser.yml
Normal file
12
.goreleaser.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
builds:
|
||||||
|
- env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- darwin
|
||||||
|
checksum:
|
||||||
|
name_template: "checksums.txt"
|
|
@ -1,7 +1,7 @@
|
||||||
FROM docker.io/library/golang:1 AS builder
|
FROM docker.io/library/golang:1 AS builder
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -a -installsuffix cgo -o bin/s3manager ./cmd/s3manager
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -a -installsuffix cgo -o bin/s3manager
|
||||||
|
|
||||||
FROM docker.io/library/alpine:latest
|
FROM docker.io/library/alpine:latest
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -1,10 +1,10 @@
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
go build -o bin/s3manager ./cmd/s3manager
|
go build -o bin/s3manager
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run:
|
||||||
go run cmd/s3manager/main.go
|
go run
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
|
@ -20,7 +20,7 @@ build-docker:
|
||||||
|
|
||||||
.PHONY: deploy-cf
|
.PHONY: deploy-cf
|
||||||
deploy-cf:
|
deploy-cf:
|
||||||
GOOS=linux go build -ldflags="-s -w" -o bin/s3manager ./cmd/s3manager
|
GOOS=linux go build -ldflags="-s -w" -o bin/s3manager
|
||||||
cf push -f deployments/cf/manifest.yml
|
cf push -f deployments/cf/manifest.yml
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
Loading…
Reference in a new issue