ntfy-alertmanager/.build.yml
Thorben Günther 84c4c45d5b
version: Use linker flag
Embedding the version file is slightly annoying for packaging, because
the release tarball is not a git repository and so "go generate" would
fail. Instead a packager would have to manually create the version.txt
file.
With using a linker flag, the version string has a graceful fallback.
2023-02-16 13:06:21 +01:00

35 lines
968 B
YAML

image: archlinux
packages:
- docker
- go
- revive
- staticcheck
secrets:
- 2b44595c-3464-4c2d-a8df-c5dea8e90c4c
sources:
- https://git.xenrox.net/~xenrox/ntfy-alertmanager
tasks:
- test: |
cd ntfy-alertmanager
go test -v ./...
- lint: |
cd ntfy-alertmanager
go vet ./...
staticcheck ./...
revive ./...
- build: |
cd ntfy-alertmanager
go build
- gofmt: |
cd ntfy-alertmanager
test -z $(gofmt -l .)
- dev-image: |
cd ntfy-alertmanager/docker
if [ "$BUILD_SUBMITTER" != "git.sr.ht" ] || [ "$(git rev-parse master)" != "$(git rev-parse HEAD)" ]
then
complete-build
fi
sudo systemctl start docker
~/.local/bin/dockerhub_login
docker build -f Dockerfile-dev -t xenrox/ntfy-alertmanager:dev ./..
docker push xenrox/ntfy-alertmanager:dev