diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..10f3db6 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,17 @@ +pipeline: + build: + image: alpine:3.13 + commands: + - apk add zip make + - make + publish: + image: plugins/gitea-release + settings: + api_key: + from_secret: GITEA_KEY + base_url: https://gitea.malloc.hackerbots.net/ + files: + - ./*.zip + - ./*.sha1 + when: + event: tag diff --git a/Makefile b/Makefile index 89f1c22..0d18e82 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,17 @@ .PHONY: all -all: malloc-items-1.0.zip malloc-items-1.0.zip.sha1 +BUILD_VERSION:=$(shell git describe --tags) -malloc-items-1.0.zip: pack.mcmeta - zip -r malloc-items-1.0.zip pack.mcmeta assets +all: malloc-items-$(BUILD_VERSION).zip malloc-items-$(BUILD_VERSION).zip.sha1 -malloc-items-1.0.zip.sha1: malloc-items-1.0.zip +pack.mcmeta: pack.mcmeta.in + sed -e 's/@VERSION@/$(BUILD_VERSION)/g' $< > $@ + +malloc-items-$(BUILD_VERSION).zip: pack.mcmeta + zip -r malloc-items-$(BUILD_VERSION).zip pack.mcmeta assets + +malloc-items-$(BUILD_VERSION).zip.sha1: malloc-items-$(BUILD_VERSION).zip sha1sum $< > $@ clean: - rm -f malloc-items-1.0.zip malloc-items-1.0.zip.sha1 + rm -f malloc-items-$(BUILD_VERSION).zip malloc-items-$(BUILD_VERSION).zip.sha1 diff --git a/pack.mcmeta b/pack.mcmeta index 2539790..b0c08cb 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "pack_format": 9, - "description": "The Magic of Malloc (1.0.0)" + "description": "The Magic of Malloc (v1.0.0)" } } diff --git a/pack.mcmeta.in b/pack.mcmeta.in new file mode 100644 index 0000000..84bacd0 --- /dev/null +++ b/pack.mcmeta.in @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 9, + "description": "The Magic of Malloc (@VERSION@)" + } +}