feat(packaging): add goreleaser recipe
This commit is contained in:
28
Makefile
28
Makefile
@ -1,6 +1,15 @@
|
||||
SHELL := /bin/bash
|
||||
DOKKU_URL := dokku@dev.lookingfora.name:rebound
|
||||
|
||||
GORELEASER_VERSION ?= v1.13.1
|
||||
GORELEASER_ARGS ?= release --snapshot --clean
|
||||
|
||||
MKT_GITEA_RELEASE_ORG ?= wpetit
|
||||
MKT_GITEA_RELEASE_PROJECT ?= rebound
|
||||
MKT_GITEA_RELEASE_VERSION ?= $(MKT_PROJECT_VERSION)
|
||||
|
||||
DEPLOY_TARGET ?= root@cadoles-rebound
|
||||
|
||||
all: build
|
||||
|
||||
watch: tools/modd/bin/modd
|
||||
@ -34,6 +43,25 @@ dokku-deploy:
|
||||
$(if $(shell git config remote.dokku.url),, git remote add dokku $(DOKKU_URL))
|
||||
git push -f dokku $(shell git rev-parse HEAD):refs/heads/master
|
||||
|
||||
.PHONY: dist
|
||||
dist: .mktools
|
||||
( set -o allexport && source .env && set +o allexport && VERSION=$(GORELEASER_VERSION) curl -sfL https://goreleaser.com/static/run | GORELEASER_CURRENT_TAG="$(MKT_PROJECT_VERSION)" bash /dev/stdin $(GORELEASER_ARGS) )
|
||||
|
||||
.PHONY: release
|
||||
release: changelog
|
||||
$(MAKE) MKT_GITEA_RELEASE_ATTACHMENTS="$$(find dist/* -type f -name '*.apk' -or -name '*.deb' -or -name '*.rpm' -or -name 'checksums.txt' -or -name 'CHANGELOG.md' | tr '\n' ' ')" mkt-gitea-release
|
||||
|
||||
.PHONY: changelog
|
||||
changelog: .mktools
|
||||
$(MAKE) MKT_GIT_CHGLOG_ARGS='--next-tag $(MKT_PROJECT_VERSION) --tag-filter-pattern $(MKT_PROJECT_VERSION_CHANNEL) --output CHANGELOG.md' mkt-changelog
|
||||
|
||||
.PHONY: deploy
|
||||
deploy: dist
|
||||
FILE=$$(find ./dist -name '*amd64.deb') \
|
||||
&& ssh $(DEPLOY_TARGET) rm -f ~/rebound_*amd64.deb \
|
||||
&& scp $${FILE} $(DEPLOY_TARGET):~/ \
|
||||
&& ssh $(DEPLOY_TARGET) dpkg -i $$(basename $${FILE})
|
||||
|
||||
.PHONY: mktools
|
||||
mktools:
|
||||
rm -rf .mktools
|
||||
|
Reference in New Issue
Block a user