diff --git a/.gitignore b/.gitignore index a8db187..26610a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -dogtamer.toml \ No newline at end of file +dogtamer.toml +gitea_token +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..c9b7a08 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,30 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + goarch: + - amd64 +archives: + - format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..4d8f79e --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,46 @@ +pipeline: + test_short: + image: golang:latest + commands: + - go build cmd/dogtamer.go + - go test -v ./... + when: + event: [pull_request, push] + + image-latest: + image: plugins/docker + settings: + repo: registry.t-juice.club/peckertest + registry: registry.t-juice.club + username: woodpecker + password: + from_secret: registry_password + tags: + - latest + - "${CI_COMMIT_SHA:0:8}" + when: + branch: master + event: push + + image-tagged: + image: plugins/docker + settings: + repo: registry.t-juice.club/peckertest + registry: registry.t-juice.club + username: woodpecker + password: + from_secret: registry_password + tags: + - "${CI_COMMIT_TAG}" + when: + event: [tag] + + goreleaser-tagged: + image: goreleaser/goreleaser + commands: + - git fetch --tags + - echo "$GITEA_TOKEN" > gitea_token + - goreleaser release + when: + event: [tag] + secrets: [gitea_token] diff --git a/Dockerfile b/Dockerfile index 9fd4c0f..d62c7a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:latest as builder +FROM golang:alpine as builder WORKDIR /app COPY go.mod /app/go.mod COPY go.sum /app/go.sum diff --git a/version.go b/version.go index 04aaf7e..4adb456 100644 --- a/version.go +++ b/version.go @@ -2,7 +2,7 @@ package dogtamer import "fmt" -const Version string = "v0.1.10" +const Version string = "v0.1.11" var Build string