build: add make publish to release a version on Gitea with its bundle
Releases on Gitea had nothing to install, so getting remus onto a Steam machine meant building the bundle and copying it across by hand. After a bump and a push with tags, make publish builds the Flatpak bundle for the tagged commit and creates the release, with the changelog entry as its notes and remus-X.Y.Z.flatpak attached. Every check runs before the slow build: a clean tree, HEAD tagged with the Cargo.toml version, a token, the same tag on the remote and no release for it yet. The token is read from GITEA_TOKEN or ~/.config/gitea/token and passed to curl in a header file, so it is never on a command line. If the upload fails, the release is deleted so the next run starts clean.
This commit is contained in:
@@ -187,6 +187,19 @@ bump:
|
||||
git tag -a "v$$new" -m "v$$new"; \
|
||||
echo "$$current -> $$new, tagged v$$new on $$(git rev-parse --short HEAD) ($$(git log -1 --format=%s))"
|
||||
|
||||
# Publishing. Builds the bundle for the version tagged on HEAD and attaches it
|
||||
# to a new Gitea release, with the changelog entry as its notes.
|
||||
GITEA_URL ?= https://gitea.anshorei.me
|
||||
GITEA_REPO ?= Fettleshed/Remus
|
||||
GITEA_REMOTE ?= origin
|
||||
GITEA_TOKEN_FILE ?= $(HOME)/.config/gitea/token
|
||||
|
||||
.PHONY: publish
|
||||
publish: ## Release the tagged version on Gitea with the Flatpak bundle attached
|
||||
@VERSION="$(CURRENT)" GITEA_URL="$(GITEA_URL)" GITEA_REPO="$(GITEA_REPO)" \
|
||||
GITEA_REMOTE="$(GITEA_REMOTE)" GITEA_TOKEN_FILE="$(GITEA_TOKEN_FILE)" \
|
||||
bash scripts/publish.sh
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove build output, screenshots and scratch config
|
||||
cargo clean
|
||||
|
||||
Reference in New Issue
Block a user