-
Notifications
You must be signed in to change notification settings - Fork 114
110 lines (100 loc) · 3.9 KB
/
submit-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Submit Release
on:
workflow_dispatch:
# push:
# tags:
# - 'v*'
# - '!*dev*'
# - '!*alpha*'
# - '!*beta*'
jobs:
release:
if: github.repository == 'anxdpanic/plugin.video.youtube' || github.event_name == 'workflow_dispatch'
name: Submit Release
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: [ 3.9 ]
steps:
- name: Checkout Add-on
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libxml2-utils xmlstarlet
python -m pip install --upgrade pip
python -m pip install git+https://github.com/romanvm/kodi-addon-submitter.git
- name: Configure git
run: |
git config --global user.name "anxdpanic"
git config --global user.email "[email protected]"
- name: Staging for Official Repository (Nexus)
id: stage-nexus
run: |
mv .git ..
rm -rf .??*
mv ../.git .
rm *.md
git add .
git commit -m "Remove Unwanted Files"
news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//')
xmlstarlet ed -L -P \
-s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \
-u '/addon/@version' -v "${version}+nexus.1" \
addon.xml
git add .
git commit -m "Update news and repository identifier"
working-directory: ${{ github.event.repository.name }}
- name: Submit to Official Repository (Nexus)
id: submit-nexus
run: |
submit-addon -r repo-plugins -b nexus --pull-request ${{ github.event.repository.name }}
working-directory: ${{ github.event.repository.name }}
env:
GH_USERNAME: anxdpanic
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
EMAIL: [email protected]
- name: Staging for Official Repository (Matrix)
id: stage-matrix
run: |
git reset --hard ${{ github.sha }}
git checkout .
git clean -fdx
mv .git ..
rm -rf .??*
mv ../.git .
rm *.md
git add .
git commit -m "Remove Unwanted Files"
news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//')
xmlstarlet ed -L -P \
-s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \
addon.xml
git add .
git commit -m "Update news"
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
xmlstarlet ed -L -P \
-u '/addon/@version' -v "${version}+matrix.1" \
-u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' \
-u '/addon/requires/import[@addon="inputstream.adaptive"]/@version' -v '19.0.0' \
-d '/addon/requires/import[@addon="script.module.infotagger"]' \
addon.xml
git add .
git commit -m "Kodi 19 Patch"
working-directory: ${{ github.event.repository.name }}
- name: Submit to Official Repository (Matrix)
id: submit-matrix
run: |
submit-addon -r repo-plugins -b matrix --pull-request ${{ github.event.repository.name }}
working-directory: ${{ github.event.repository.name }}
env:
GH_USERNAME: anxdpanic
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
EMAIL: [email protected]