Skip to content

Commit 1e74ec0

Browse files
committed
script.skinshortcuts-3.0.0~beta4
1 parent 4bfc3d5 commit 1e74ec0

36 files changed

+337
-566
lines changed

.github/workflows/addon-validations.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616

1717
steps:
1818
- name: Set up Python v3.9
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.9'
2222

2323
- name: Checkout Add-on
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
2626
path: ${{ github.event.repository.name }}
2727

@@ -31,7 +31,6 @@ jobs:
3131
python -m pip install isort
3232
python -m pip install pylint
3333
python -m pip install simpleeval
34-
python -m pip install unidecode
3534
python -m pip install git+https://github.com/xbmc/addon-check.git
3635
3736
- name: Kodi Add-on Checker

.github/workflows/close-translation-prs.yml

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,54 @@ name: Close Translation Pull Requests
22

33
on:
44
pull_request:
5-
branches: [ master, main, dev ]
5+
branches: [ main ]
66

77
jobs:
88

99
close-translation-prs:
10-
if: github.actor != 'weblate' && github.actor != 'anxdpanic' && github.repository == 'mikesilvo164/script.skinshortcuts'
10+
if: github.actor != 'weblate' && github.repository == 'MikeSiLVO/script.skinshortcuts'
1111

1212
name: Close Translation Pull Requests
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Get changed files
17-
id: modified_files
18-
uses: trilom/file-changes-action@v1.2.4
16+
- name: Check and close translation PRs
17+
uses: actions/github-script@v7
1918
with:
20-
output: ","
21-
22-
- name: Check the PR for translations
23-
id: check
24-
run: |
25-
shopt -s nocasematch
26-
if [[ "${{ steps.modified_files.outputs.files_modified }}" == *"en_gb/strings.po"* ]]; then
27-
echo "Found modified en_gb, likely a valid PR"
28-
unset CLOSE
29-
elif [[ "${{ steps.modified_files.outputs.files_modified }}" == *"strings.po"* ]]; then
30-
echo "Found modified strings.po, unwanted."
31-
CLOSE="true"
32-
elif [[ "${{ steps.modified_files.outputs.files_added }}" == *"strings.po"* ]]; then
33-
echo "Found added strings.po, unwanted."
34-
CLOSE="true"
35-
elif [[ "${{ steps.modified_files.outputs.files_removed }}" == *"strings.po"* ]]; then
36-
echo "Found removed strings.po, unwanted."
37-
CLOSE="true"
38-
else
39-
echo "No strings.po were modified or added, not a translation."
40-
unset CLOSE
41-
fi
42-
echo ::set-output name=close::${CLOSE}
43-
44-
- name: Comment on the PR
45-
uses: mshick/add-pr-comment@v1
46-
if: ${{ steps.check.outputs.close }}
47-
with:
48-
repo-token: ${{ secrets.GITHUB_TOKEN }}
49-
repo-token-user-login: 'github-actions[bot]'
50-
allow-repeats: true
51-
message: |
52-
A modified strings.po file was detected.
19+
script: |
20+
const { data: files } = await github.rest.pulls.listFiles({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
pull_number: context.payload.pull_request.number
24+
});
25+
26+
const hasEnGb = files.some(f => f.filename.includes('en_gb/strings.po'));
27+
const hasStrings = files.some(f => f.filename.includes('strings.po'));
28+
29+
// Allow if en_gb was modified (likely valid PR) or no strings.po at all
30+
if (hasEnGb || !hasStrings) {
31+
console.log('Not a translation-only PR, allowing through');
32+
return;
33+
}
34+
35+
// Close translation PRs from non-Weblate contributors
36+
console.log('Translation PR detected, closing');
37+
38+
await github.rest.issues.createComment({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
issue_number: context.payload.pull_request.number,
42+
body: `A modified strings.po file was detected.
5343
5444
Translations are not accepted through PRs, please use Weblate if you'd like to contribute to the translations.
55-
For more information see Issue #58.
5645
5746
If you feel this PR was closed in error, please reply below.
58-
Thank you for your interest in improving this add-on.
59-
60-
- name: Close the PR
61-
uses: peter-evans/close-pull@v1
62-
if: ${{ steps.check.outputs.close }}
47+
Thank you for your interest in improving this add-on.`
48+
});
49+
50+
await github.rest.pulls.update({
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
pull_number: context.payload.pull_request.number,
54+
state: 'closed'
55+
});

.github/workflows/make-release.yml

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,59 @@
1-
# Based on https://github.com/im85288/service.upnext/blob/master/.github/workflows/release.yml
21
name: Make Release
2+
33
on:
44
push:
55
tags:
66
- 'v*'
7-
- '*.alpha*'
8-
- '*.beta*'
97

108
jobs:
119
release:
1210
name: Make Release
1311
runs-on: ubuntu-latest
1412

1513
steps:
16-
- name: Release Status
17-
id: release
18-
run: |
19-
version=${GITHUB_REF/refs\/tags\//}
20-
if [[ $version == *.alpha* || $version == *.beta* ]] ;
21-
then
22-
echo ::set-output name=pre-release::true
23-
else
24-
echo ::set-output name=pre-release::false
25-
fi
26-
2714
- name: Checkout Add-on
28-
uses: actions/checkout@v3
29-
with:
30-
path: ${{ github.event.repository.name }}
15+
uses: actions/checkout@v4
3116

3217
- name: Install dependencies
3318
run: |
3419
sudo apt-get update
3520
sudo apt-get install libxml2-utils xmlstarlet zip
3621
37-
- name: Get Variables
38-
id: variables
22+
- name: Get addon info
23+
id: addon-info
3924
run: |
40-
changes=$(xmlstarlet sel -t -v '//news' -n addon.xml)
41-
changes="${changes//'%'/'%25'}"
42-
changes="${changes//$'\n'/'%0A'}"
43-
changes="${changes//$'\r'/'%0D'}"
4425
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
45-
echo ::set-output name=changes::$changes
46-
echo ::set-output name=version::$version
47-
working-directory: ${{ github.event.repository.name }}
26+
echo "version=$version" >> $GITHUB_OUTPUT
27+
28+
# Extract changelog, preserve newlines for release body
29+
changelog=$(xmlstarlet sel -t -v '//news' addon.xml)
30+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
31+
echo "$changelog" >> $GITHUB_OUTPUT
32+
echo "EOF" >> $GITHUB_OUTPUT
33+
34+
# Check if pre-release (addon.xml uses ~ for pre-release)
35+
if [[ $version == *~alpha* || $version == *~beta* ]]; then
36+
echo "prerelease=true" >> $GITHUB_OUTPUT
37+
else
38+
echo "prerelease=false" >> $GITHUB_OUTPUT
39+
fi
4840
4941
- name: Create Zip
5042
id: zip
5143
run: |
52-
git reset
53-
git checkout .
54-
git clean -fdx
55-
mv .git ..
56-
rm -rf .??*
57-
rm LICENSE.txt
44+
# Clean up for release
45+
rm -rf .git .github .gitignore .pylintrc
5846
cd ..
59-
filename=${{ github.event.repository.name }}-${{ steps.variables.outputs.version }}.zip
47+
filename=${{ github.event.repository.name }}-${{ steps.addon-info.outputs.version }}.zip
6048
zip -r $filename ${{ github.event.repository.name }}
61-
mv .git ${{ github.event.repository.name }}
62-
echo ::set-output name=filename::$filename
63-
working-directory: ${{ github.event.repository.name }}
49+
echo "filename=$filename" >> $GITHUB_OUTPUT
6450
6551
- name: Create Release
66-
id: create-release
67-
uses: actions/create-release@v1
68-
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
uses: softprops/action-gh-release@v2
7053
with:
71-
tag_name: ${{ github.ref }}
72-
release_name: ${{ github.ref }}
73-
body: ${{ steps.variables.outputs.changes }}
74-
draft: false
75-
prerelease: ${{ steps.release.outputs.pre-release }}
76-
77-
- name: Upload Zip (Matrix)
78-
id: upload-matrix
79-
uses: actions/upload-release-asset@v1
54+
name: v${{ steps.addon-info.outputs.version }}
55+
body: ${{ steps.addon-info.outputs.changelog }}
56+
prerelease: ${{ steps.addon-info.outputs.prerelease }}
57+
files: ../${{ steps.zip.outputs.filename }}
8058
env:
8159
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
with:
83-
upload_url: ${{ steps.create-release.outputs.upload_url }}
84-
asset_name: ${{ steps.zip.outputs.filename }}
85-
asset_path: ${{ steps.zip.outputs.filename }}
86-
asset_content_type: application/zip

.github/workflows/submit-release.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/sync-addon-metadata-translations.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,43 @@ name: Sync addon metadata translations
22

33
on:
44
push:
5-
branches: [ master, main ]
5+
branches: [ main ]
66
paths:
77
- '**addon.xml'
88
- '**resource.language.**strings.po'
99

1010
jobs:
11-
default:
12-
if: github.repository == 'mikesilvo164/script.skinshortcuts'
11+
sync-translations:
12+
# PAUSED: Re-enable when main replaces master and Weblate PR is merged
13+
# Change 'false' to the condition below to re-enable:
14+
# github.repository == 'MikeSiLVO/script.skinshortcuts'
15+
if: false
16+
17+
name: Sync addon metadata translations
1318
runs-on: ubuntu-latest
1419

1520
steps:
16-
17-
# Checkout the current repository into the 'project' directory
1821
- name: Checkout repository
19-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2023
with:
2124
path: project
2225

23-
# Setup python version 3.9
2426
- name: Set up Python
25-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
2628
with:
2729
python-version: '3.9'
2830

29-
# Install all dependencies required by the following steps
30-
# - git+https://github.com/xbmc/sync_addon_metadata_translations.git: main script for this action
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
3434
python -m pip install git+https://github.com/xbmc/sync_addon_metadata_translations.git
3535
36-
# Run the sync-addon-metadata-translations against the 'project' directory
3736
- name: Run sync-addon-metadata-translations
38-
run: |
39-
sync-addon-metadata-translations
37+
run: sync-addon-metadata-translations
4038
working-directory: ./project
4139

42-
# Create a PR with any changes made by the sync-addon-metadata-translations script
43-
# - title/commit message: Sync of addon metadata translations
44-
# - body: Sync of addon metadata translations triggered by {github.sha}
45-
- name: Create PR for sync-addon-metadata-translations changes
46-
uses: peter-evans/create-pull-request@v3.10.0
40+
- name: Create PR for sync changes
41+
uses: peter-evans/create-pull-request@v7
4742
with:
4843
commit-message: Sync of addon metadata translations
4944
title: Sync of addon metadata translations

addon.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.skinshortcuts" name="Skin Shortcuts" version="3.0.0~beta3" provider-name="BigNoid, marcelveldt, SiLVO, anxdpanic">
2+
<addon id="script.skinshortcuts" name="Skin Shortcuts" version="3.0.0~beta4" provider-name="SiLVO, anxdpanic">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
5-
<import addon="script.module.unidecode" version="1.1.1+matrix.2"/>
65
<import addon="script.module.simpleeval" version="0.9.10"/>
76
</requires>
87
<extension point="xbmc.python.script" library="default.py"/>
98
<extension point="xbmc.addon.metadata">
109
<news>
11-
[fix] translations in PVR |contrib: Dis90|
12-
[fix] titles missing in some dialogs
13-
[fix] handle missing profiles.xml gracefully (fixes Apple TV)
14-
[lang] update translations from Weblate
10+
v3.0.0~beta4
11+
- Complete addon rewrite
12+
- JSON-based userdata
1513
</news>
14+
<summary lang="en_GB">Custom menus, properties, and artwork for skins</summary>
1615
<platform>all</platform>
1716
<license>GPL-2.0-only</license>
1817
<forum>https://forum.kodi.tv/showthread.php?tid=178294</forum>

0 commit comments

Comments
 (0)