Skip to content

Commit

Permalink
Add makefile for creating zip and do releases
Browse files Browse the repository at this point in the history
The 'dist' target create a zip file to install on the Kodi instance,
and the 'prepare_release' target fetch the Kodi addon repo git
repository and copy the latest add-on there for pushing to the official
addon collection.
  • Loading branch information
petterreinholdtsen committed Nov 5, 2022
1 parent c7090a4 commit fc86876
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ADDON_NAME := $(shell grep '<addon id="' addon.xml |cut -d\" -f2)
VERSION := $(shell grep ' version=' addon.xml |cut -d\" -f2)
FILES = addon.py addon.xml changelog.txt fanart.jpg icon.png LICENSE.txt \
main.py nrktv.py resources subs.py
REPO_PLUGINS ?= ../repo-plugins
RELEASE_BRANCH ?= matrix

all: dist

dist:
mkdir -p tmpdir/plugin.$(ADDON_NAME)
cp -r $(FILES) tmpdir/plugin.$(ADDON_NAME)/
(cd tmpdir; zip -r ../plugin.$(ADDON_NAME)-$(VERSION).zip plugin.$(ADDON_NAME)/ \
--exclude \*.pyc)
rm -r tmpdir/plugin.$(ADDON_NAME)
rmdir tmpdir

prepare_release:
[ -d "$(REPO_PLUGINS)" ] || \
git clone --depth 5 -b $(RELEASE_BRANCH) https://github.com/xbmc/repo-scripts "$(REPO_PLUGINS)"
git -C $(REPO_PLUGINS) stash
git -C $(REPO_PLUGINS) checkout $(RELEASE_BRANCH)
rm -rf $(REPO_PLUGINS)/plugin.$(ADDON_NAME)
mkdir $(REPO_PLUGINS)/plugin.$(ADDON_NAME)
cp -r $(FILES) $(REPO_PLUGINS)/plugin.$(ADDON_NAME)/

clean:
rm *.zip

0 comments on commit fc86876

Please sign in to comment.