mirror of
https://github.com/greenpau/caddy-security.git
synced 2025-04-18 08:04:02 +03:00
github: add goreleaser github action
This commit is contained in:
parent
e628cc1ee3
commit
d3650bbfcf
31
.github/workflows/release.yml
vendored
Normal file
31
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: git fetch --force --tags
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '>=1.19.4'
|
||||
cache: true
|
||||
- uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
dist/**
|
||||
assets/config/users.json
|
||||
vendor/**
|
||||
bin/**
|
||||
|
41
.goreleaser.yaml
Normal file
41
.goreleaser.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
project_name: authp
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
- GO111MODULE=on
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
main: ./cmd/authp
|
||||
binary: ./bin/authp
|
||||
flags:
|
||||
- -trimpath
|
||||
- -mod=readonly
|
||||
asmflags:
|
||||
- all=-trimpath={{.Env.GOPATH}}
|
||||
gcflags:
|
||||
- all=-trimpath={{.Env.GOPATH}}
|
||||
ldflags: -s -w
|
||||
|
||||
|
||||
nfpms:
|
||||
- id: authp
|
||||
file_name_template: >-
|
||||
{{ .ProjectName }}_
|
||||
{{- title .Os }}_
|
||||
{{- if eq .Arch "amd64" }}x86_64
|
||||
{{- else if eq .Arch "386" }}i386
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- '^docs?:'
|
||||
- '^readme:'
|
||||
- '^tests?:'
|
||||
# - '^\w+\s+' # a hack to remove commit messages without colons thus don't correspond to a package
|
3
Makefile
3
Makefile
@ -18,7 +18,7 @@ all: info
|
||||
@# --with github.com/greenpau/caddy-security@$(LATEST_GIT_COMMIT)=$(BUILD_DIR)
|
||||
@# --with github.com/greenpau/caddy-trace@v1.1.10
|
||||
@#--with github.com/greenpau/go-authcrunch@v1.0.37=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch
|
||||
@go build -v -o ./bin/caddy cmd/caddy/main.go
|
||||
@go build -v -o ./bin/caddy cmd/authp/main.go
|
||||
@./bin/caddy version
|
||||
@#bin/caddy run -config assets/config/Caddyfile
|
||||
@for f in `find ./assets -type f -name 'Caddyfile'`; do bin/caddy fmt --overwrite $$f; done
|
||||
@ -87,6 +87,7 @@ dep:
|
||||
@echo "Making dependencies check ..."
|
||||
@go install golang.org/x/lint/golint@latest
|
||||
@go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
|
||||
@go install github.com/goreleaser/goreleaser@latest
|
||||
@go install github.com/greenpau/versioned/cmd/versioned@latest
|
||||
@go install github.com/kyoh86/richgo@latest
|
||||
@echo "DEBUG: completed $@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user