add support for goreleaser [skip ci]

This commit is contained in:
surtur 2023-08-05 15:02:26 +02:00
parent e941e73222
commit 1fcee6ccbd
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
4 changed files with 67 additions and 1 deletions

View File

@ -7,7 +7,7 @@ tmp_dir = "tmp"
args_bin = ["-devel"]
cmd = "go mod tidy && go build -v -ldflags=\"-X main.version=$(git rev-parse --short HEAD)-air\" ."
delay = 700 # ms
exclude_dir = ["assets", "tmp", "vendor", "testdata", "node_modules", "static", "templates"]
exclude_dir = ["assets", "tmp", "vendor", "testdata", "node_modules", "static", "templates", "dist"]
exclude_file = []
exclude_regex = ["_test.go", "node_modules/*"]
exclude_unchanged = true

2
.envrc
View File

@ -1,3 +1,5 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="
use devenv
t=${XDG_RUNTIME_DIR}/secrets/pcmt_gitea_token; test -f ${t} && source_env ${t} && unset ${t}

3
.gitignore vendored
View File

@ -9,6 +9,9 @@ pcmt
# air tmp dir
/tmp
# goreleaser dir.
/dist
Session.vim
/node_modules/

61
.goreleaser.yaml Normal file
View File

@ -0,0 +1,61 @@
# Copyright 2023 wanderer <a_mirre at utb dot cz>
# SPDX-License-Identifier: GPL-3.0-or-later
---
project_name: pcmt
git:
prerelease_suffix: "-rc"
archives:
# - name_template: '{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}'
- name_template: '{{ .ProjectName }}_v{{ .Version }}'
meta: true
files:
- README.md
- LICENSE
- exampleConfig.dhall
before:
hooks:
- go generate .
- go mod tidy
builds:
- env: [CGO_ENABLED=0]
goamd64:
- v2
flags:
- -trimpath
goarch:
- amd64
- arm64
goos:
- linux
- freebsd
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }}
mod_timestamp: '{{ .CommitTimestamp }}'
release:
disable: false
draft: false
prerelease: true
skip_upload: false
extra_files:
- glob: ./README.md
- glob: ./LICENSE
- glob: ./exampleConfig.dhall
mode: replace
gitea:
owner: mirre-mt
name: pcmt
sboms:
- artifacts: binary
snapshot:
# Default is `{{ .Version }}-SNAPSHOT-{{.ShortCommit}}`. Templates: allowed.
name_template: '{{ incpatch .Version }}_pre-g{{.ShortCommit}}-dev'
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA512SUMS.txt"
algorithm: sha512
changelog:
use: git
sort: asc
gitea_urls:
api: https://git.dotya.ml/api/v1
download: https://git.dotya.ml