ci: just the beginning
This commit is contained in:
parent
100a726730
commit
b97f06a2c6
12
.github/workflows/ci.yml
vendored
Normal file
12
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
name: "ci"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
- run: nix develop . -c golangci-lint run --enable-all
|
||||
- run: nix develop . -c go test -v -race ./...
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
.direnv
|
||||
result
|
||||
|
||||
dist/
|
||||
|
44
.goreleaser.yaml
Normal file
44
.goreleaser.yaml
Normal file
@ -0,0 +1,44 @@
|
||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||
version: 2
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
ldflags:
|
||||
- "-s"
|
||||
- "-w"
|
||||
- "-extldflags '-static'"
|
||||
archives:
|
||||
- format: tar.gz
|
||||
# this name template makes the OS and Arch compatible with the results of `uname`.
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_ {{- title .Os }}_ {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} {{- if .Arm }}v{{ .Arm }}{{ end }}
|
||||
# use zip for windows archives
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
dockers:
|
||||
- image_templates:
|
||||
- xsteadfastx/caddy-log-exporter:{{ .Tag }}-amd64
|
||||
use: buildx
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--platform=linux/amd64"
|
||||
- image_templates:
|
||||
- xsteadfastx/caddy-log-exporter:{{ .Tag }}-arm64
|
||||
use: buildx
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--platform=linux/arm64"
|
||||
goarch: arm64
|
3
Dockerfile
Normal file
3
Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM scratch
|
||||
ENTRYPOINT ["/caddy-log-exporter"]
|
||||
COPY caddy-log-exporter /
|
14
Taskfile.yml
14
Taskfile.yml
@ -6,6 +6,7 @@ tasks:
|
||||
cmds:
|
||||
- task: lint
|
||||
- task: test
|
||||
- task: release-snapshot
|
||||
|
||||
lint:
|
||||
cmds:
|
||||
@ -14,3 +15,16 @@ tasks:
|
||||
test:
|
||||
cmds:
|
||||
- "{{.NIX_CMD_BASE}} go test -v -race ./..."
|
||||
|
||||
tidy:
|
||||
cmds:
|
||||
- go mod tidy
|
||||
- go mod vendor
|
||||
|
||||
release:
|
||||
cmds:
|
||||
- "{{.NIX_CMD_BASE}} goreleaser release --clean"
|
||||
|
||||
release-snapshot:
|
||||
cmds:
|
||||
- "{{.NIX_CMD_BASE}} goreleaser release --clean --snapshot"
|
||||
|
Loading…
Reference in New Issue
Block a user