From 0a678f936b569bbc2dc36c745bb966bc3cee061e Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 18 Nov 2020 13:21:38 +0100 Subject: Add auto-release infrastructure --- .gitlab-ci.yml | 20 +++++++++++++++ Makefile | 59 ++++++++++++++++++++++++++++++------------- tools/do_release.sh | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/get_p2_url.py | 21 +++++++++++++-- 4 files changed, 153 insertions(+), 20 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 tools/do_release.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..0896758 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +stages: + - build + - release + +on-schedule: + stage: build + image: python3 + only: + - schedules + script: + - sh tools/do_release.sh + +release: + stage: release + image: python3 + script: + - pip3 install gitlab-release + - gitlab-release --zip "release-${CI_COMMIT_TAG}.zip" * + only: + - tags diff --git a/Makefile b/Makefile index a029670..1d573db 100644 --- a/Makefile +++ b/Makefile @@ -4,38 +4,61 @@ BUILDDIR ?= build WGET ?= wget PYTHON ?= python3 -$(BUILDDIR): - mkdir -p $(BUILDDIR) - .PRECIOUS: $(BUILDDIR)/%.jar +.PRECIOUS: $(BUILDDIR)/%.jar.version $(BUILDDIR)/%.jar: mkdir -p $(BUILDDIR) - $(WGET) --tries=10 -N -O $@ $$($(PYTHON) tools/get_p2_url.py $*) + $(WGET) --tries=10 -O $@ $$($(PYTHON) tools/get_p2_url.py --write-version $@.version $*) touch $@ +OUTPUTS := svd mx_mcu_db prog_db chip_db + +all: $(OUTPUTS) + $(BUILDDIR)/%.dir: $(BUILDDIR)/%.jar mkdir -p $@ rm -rf $@ - unzip -d $@ $< + unzip -q -d $@ $< .PHONY: update_svd -update_svd: $(BUILDDIR)/com.st.stm32cube.ide.mcu.productdb.debug.dir - rm -rf svd - mkdir -p svd - cp $