Compare commits

...

1 Commits

Author SHA1 Message Date
Michaël Arnauts
a05d396897 Comment out xbmc.python in addon.xml 2021-03-29 16:53:23 +02:00
5 changed files with 48 additions and 37 deletions

View File

@ -1,4 +1,4 @@
name: Kodi name: Kodi Addon-Check
on: on:
# Run action when pushed to master, or for commits in a pull request. # Run action when pushed to master, or for commits in a pull request.
push: push:
@ -19,9 +19,10 @@ jobs:
- name: Check out ${{ github.sha }} from repository ${{ github.repository }} - name: Check out ${{ github.sha }} from repository ${{ github.repository }}
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Run kodi-addon-checker - name: Install dependencies
uses: xbmc/action-kodi-addon-checker@v1.2 run: |
with: sudo apt-get install libxml2-utils
kodi-version: ${{ matrix.kodi-version }} sudo python -m pip install kodi-addon-checker
rewrite-for-matrix: ${{ matrix.kodi-version == 'matrix' }}
addon-id: ${{ github.event.repository.name }} - name: Run Addon Check for Kodi ${{matrix.kodi-version}}
run: make check-addon-${{matrix.kodi-version}}

View File

@ -12,11 +12,13 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install libxml2-utils
- name: Build zip files - name: Build zip files
id: build id: build
run: | run: |
sudo apt-get install libxml2-utils make build-all release=1
make multizip release=1
echo ::set-output name=leia-filename::$(cd ..;ls plugin.video.viervijfzes*.zip | grep -v '+matrix.' | head -1) echo ::set-output name=leia-filename::$(cd ..;ls plugin.video.viervijfzes*.zip | grep -v '+matrix.' | head -1)
echo ::set-output name=matrix-filename::$(cd ..;ls plugin.video.viervijfzes*+matrix.*.zip | head -1) echo ::set-output name=matrix-filename::$(cd ..;ls plugin.video.viervijfzes*+matrix.*.zip | head -1)

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ tests/home/userdata/addon_data
Pipfile Pipfile
Pipfile.lock Pipfile.lock
dist/

View File

@ -1,25 +1,21 @@
export KODI_HOME := $(CURDIR)/tests/home export KODI_HOME := $(CURDIR)/tests/home
export KODI_INTERACTIVE := 0 export KODI_INTERACTIVE := 0
PYTHON := python PYTHON := python
KODI_PYTHON_ABIS := 3.0.0 2.26.0
# Collect information to build as sensible package name # Collect information to build as sensible package name
name = $(shell xmllint --xpath 'string(/addon/@id)' addon.xml) name = $(shell xmllint --xpath 'string(/addon/@id)' addon.xml)
version = $(shell xmllint --xpath 'string(/addon/@version)' addon.xml) version = $(shell xmllint --xpath 'string(/addon/@version)' addon.xml)
git_branch = $(shell git rev-parse --abbrev-ref HEAD)
git_hash = $(shell git rev-parse --short HEAD)
ifdef release ifdef release
zip_name = $(name)-$(version).zip zip_name = $(name)-$(version).zip
else else
git_branch = $(shell git rev-parse --abbrev-ref HEAD)
git_hash = $(shell git rev-parse --short HEAD)
zip_name = $(name)-$(version)-$(git_branch)-$(git_hash).zip zip_name = $(name)-$(version)-$(git_branch)-$(git_hash).zip
endif endif
zip_dir = $(name)/
languages = $(filter-out en_gb, $(patsubst resources/language/resource.language.%, %, $(wildcard resources/language/*)))
all: check test build all: check test build
zip: build zip: build
multizip: build-all
check: check-pylint check-translations check: check-pylint check-translations
@ -29,17 +25,20 @@ check-pylint:
check-translations: check-translations:
@printf ">>> Running translation checks\n" @printf ">>> Running translation checks\n"
@$(foreach lang,$(languages), \ @$(foreach lang,$(filter-out en_gb, $(patsubst resources/language/resource.language.%, %, $(wildcard resources/language/*))), \
msgcmp resources/language/resource.language.$(lang)/strings.po resources/language/resource.language.en_gb/strings.po; \ msgcmp resources/language/resource.language.$(lang)/strings.po resources/language/resource.language.en_gb/strings.po; \
) )
@tests/check_for_unused_translations.py @tests/check_for_unused_translations.py
check-addon: clean build check-addon: check-addon-matrix
check-addon-leia:
@printf ">>> Running addon checks\n" @printf ">>> Running addon checks\n"
$(eval TMPDIR := $(shell mktemp -d)) @make -s build-leia && cd dist/ && kodi-addon-checker --branch=leia
@unzip ../${zip_name} -d ${TMPDIR}
cd ${TMPDIR} && kodi-addon-checker --branch=leia check-addon-matrix:
@rm -rf ${TMPDIR} @printf ">>> Running addon checks\n"
@make -s build-matrix && cd dist/ && kodi-addon-checker --branch=matrix
codefix: codefix:
@isort -l 160 resources/ @isort -l 160 resources/
@ -56,12 +55,29 @@ clean:
@find . -name '__pycache__' -type d -delete @find . -name '__pycache__' -type d -delete
@rm -rf .pytest_cache/ tests/cdm tests/userdata/temp @rm -rf .pytest_cache/ tests/cdm tests/userdata/temp
@rm -f *.log .coverage @rm -f *.log .coverage
@rm -rf dist/
build: clean build: build-matrix
@printf ">>> Building package\n"
@rm -f ../$(zip_name) build-all: build-leia build-matrix
@git archive --format zip --worktree-attributes -v -o ../$(zip_name) --prefix $(zip_dir) $(or $(shell git stash create), HEAD)
@printf ">>> Successfully wrote package as: ../$(zip_name)\n" build-leia: clean
$(eval abi=2.26.0)
@rm -rf dist/ && mkdir dist/
@git archive --format tar --worktree-attributes --prefix $(name)/ $(or $(shell git stash create), HEAD) | (cd dist/ && tar -xf -)
@sed -i -E "s/(<!--)?(\s*<import addon=\"xbmc\.python\" version=\")[0-9\.]*(\"\/>)(\s*-->)?/\2$(abi)\3/" dist/$(name)/addon.xml
@cd dist && zip --quiet -9 -r ../../$(zip_name) $(name)
@printf ">>> Successfully wrote package for Kodi 18 as ../$(zip_name)\n"
build-matrix: clean
$(eval abi=3.0.0)
$(eval version=$(version)+matrix.1)
@rm -rf dist/ && mkdir dist/
@git archive --format tar --worktree-attributes --prefix $(name)/ $(or $(shell git stash create), HEAD) | (cd dist/ && tar -xf -)
@sed -i -E "s/(<!--)?(\s*<import addon=\"xbmc\.python\" version=\")[0-9\.]*(\"\/>)(\s*-->)?/\2$(abi)\3/" dist/$(name)/addon.xml
@printf "cd /addon/@version\nset $(version)\nsave\nbye\n" | xmllint --shell dist/$(name)/addon.xml > /dev/null
@cd dist && zip --quiet -9 -r ../../$(zip_name) $(name)
@printf ">>> Successfully wrote package for Kodi 19 as ../$(zip_name)\n"
# You first need to run sudo gem install github_changelog_generator for this # You first need to run sudo gem install github_changelog_generator for this
release: release:
@ -79,12 +95,3 @@ ifneq ($(release),)
else else
@printf "Usage: make release release=1.0.0\n" @printf "Usage: make release release=1.0.0\n"
endif endif
multizip: clean
@-$(foreach abi,$(KODI_PYTHON_ABIS), \
printf "cd /addon/requires/import[@addon='xbmc.python']/@version\nset $(abi)\nsave\nbye\n" | xmllint --shell addon.xml; \
matrix=$(findstring $(abi), $(word 1,$(KODI_PYTHON_ABIS))); \
if [ $$matrix ]; then version=$(version)+matrix.1; else version=$(version); fi; \
printf "cd /addon/@version\nset $$version\nsave\nbye\n" | xmllint --shell addon.xml; \
make build; \
)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.viervijfzes" name="GoPlay" version="0.4.2" provider-name="Michaël Arnauts"> <addon id="plugin.video.viervijfzes" name="GoPlay" version="0.4.2" provider-name="Michaël Arnauts">
<requires> <requires>
<import addon="xbmc.python" version="2.26.0"/> <!--<import addon="xbmc.python" version="3.0.0"/>-->
<import addon="script.module.dateutil" version="2.6.0"/> <import addon="script.module.dateutil" version="2.6.0"/>
<import addon="script.module.inputstreamhelper" version="0.5.1"/> <import addon="script.module.inputstreamhelper" version="0.5.1"/>
<import addon="script.module.pysocks" version="1.6.8" optional="true"/> <import addon="script.module.pysocks" version="1.6.8" optional="true"/>