Skip to content

Commit 3fdca21

Browse files
committed
Update integrations
1 parent 0239dc6 commit 3fdca21

File tree

2 files changed

+183
-0
lines changed

2 files changed

+183
-0
lines changed

.github/workflows/make-release.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Based on https://github.com/im85288/service.upnext/blob/master/.github/workflows/release.yml
2+
name: Make Release
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
- '*-dev'
8+
9+
jobs:
10+
release:
11+
if: github.repository == 'anxdpanic/script.module.python.twitch'
12+
13+
name: Make Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Release Status
18+
id: release
19+
run: |
20+
version=${GITHUB_REF/refs\/tags\//}
21+
if [[ $version == *-dev ]] ;
22+
then
23+
echo ::set-output name=pre-release::true
24+
else
25+
echo ::set-output name=pre-release::false
26+
fi
27+
28+
- name: Checkout Add-on
29+
uses: actions/checkout@v2
30+
with:
31+
path: ${{ github.event.repository.name }}
32+
33+
- name: Install dependencies
34+
run: |
35+
sudo apt-get install libxml2-utils xmlstarlet zip
36+
37+
- name: Get Changelog
38+
id: changelog
39+
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'}"
44+
echo ::set-output name=changes::$changes
45+
working-directory: ${{ github.event.repository.name }}
46+
47+
- name: Remove Unwanted Files
48+
run: |
49+
mv .git ..
50+
rm -rf .??*
51+
rm *.md
52+
53+
- name: Create Zip (Isengard)
54+
id: zip-isengard
55+
run: |
56+
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
57+
filename=${{ github.event.repository.name }}-${version}.zip
58+
cd ..
59+
zip -r $filename ${{ github.event.repository.name }}
60+
echo ::set-output name=filename::$filename
61+
working-directory: ${{ github.event.repository.name }}
62+
63+
- name: Create Zip (Matrix)
64+
id: zip-matrix
65+
run: |
66+
xmlstarlet ed -L -u '//import[@addon="xbmc.python"]/@version' -v "3.0.0" addon.xml
67+
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
68+
xmlstarlet ed -L -u '/addon/@version' -v "${version}+matrix.1" addon.xml
69+
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
70+
filename=${{ github.event.repository.name }}-${version}.zip
71+
cd ..
72+
zip -r $filename ${{ github.event.repository.name }}
73+
mv .git ${{ github.event.repository.name }}
74+
echo ::set-output name=filename::$filename
75+
working-directory: ${{ github.event.repository.name }}
76+
77+
- name: Create Release
78+
id: create-release
79+
uses: actions/create-release@v1
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
with:
83+
tag_name: ${{ github.ref }}
84+
release_name: ${{ github.ref }}
85+
body: ${{ steps.changelog.outputs.changes }}
86+
draft: false
87+
prerelease: ${{ steps.release.outputs.pre-release }}
88+
89+
- name: Upload Zip (Isengard)
90+
id: upload-isengard
91+
uses: actions/upload-release-asset@v1
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
with:
95+
upload_url: ${{ steps.create-release.outputs.upload_url }}
96+
asset_name: ${{ steps.zip-isengard.outputs.filename }}
97+
asset_path: ${{ steps.zip-isengard.outputs.filename }}
98+
asset_content_type: application/zip
99+
100+
- name: Upload Zip (Matrix)
101+
id: upload-matrix
102+
uses: actions/upload-release-asset@v1
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
with:
106+
upload_url: ${{ steps.create-release.outputs.upload_url }}
107+
asset_name: ${{ steps.zip-matrix.outputs.filename }}
108+
asset_path: ${{ steps.zip-matrix.outputs.filename }}
109+
asset_content_type: application/zip
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Submit Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
release:
9+
if: github.repository == 'anxdpanic/script.module.python.twitch'
10+
11+
name: Submit Release
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
16+
fail-fast: false
17+
matrix:
18+
python-version: [ 3.9 ]
19+
20+
steps:
21+
- name: Checkout Add-on
22+
uses: actions/checkout@v2
23+
with:
24+
path: ${{ github.event.repository.name }}
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: |
33+
sudo apt-get install libxml2-utils xmlstarlet zip
34+
python -m pip install --upgrade pip
35+
python -m pip install git+https://github.com/romanvm/kodi-addon-submitter.git
36+
37+
- name: Configure git
38+
run: |
39+
git config --global user.name "anxdpanic"
40+
git config --global user.email "anxdpanic@users.noreply.github.com"
41+
42+
- name: Remove Unwanted Files
43+
run: |
44+
mv .git ..
45+
rm -rf .??*
46+
rm *.md
47+
48+
- name: Submit to Official Repository (Isengard)
49+
id: submit-isengard
50+
run: |
51+
submit-addon -r repo-scripts -b isengard --push-branch ${{ github.event.repository.name }}
52+
working-directory: ${{ github.event.repository.name }}
53+
env:
54+
GH_USERNAME: anxdpanic
55+
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
56+
EMAIL: anxdpanic@users.noreply.github.com
57+
58+
- name: Staging for Official Repository (Matrix)
59+
id: stage-matrix
60+
run: |
61+
xmlstarlet ed -L -u '//import[@addon="xbmc.python"]/@version' -v "3.0.0" addon.xml
62+
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
63+
xmlstarlet ed -L -u '/addon/@version' -v "${version}+matrix.1" addon.xml
64+
working-directory: ${{ github.event.repository.name }}
65+
66+
- name: Submit to Official Repository (Matrix)
67+
id: submit-matrix
68+
run: |
69+
submit-addon -r repo-scripts -b matrix --push-branch ${{ github.event.repository.name }}
70+
working-directory: ${{ github.event.repository.name }}
71+
env:
72+
GH_USERNAME: anxdpanic
73+
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
74+
EMAIL: anxdpanic@users.noreply.github.com

0 commit comments

Comments
 (0)