-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathpublish-addon.sh
More file actions
executable file
·30 lines (25 loc) · 1.1 KB
/
Copy pathpublish-addon.sh
File metadata and controls
executable file
·30 lines (25 loc) · 1.1 KB
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
#!/bin/bash
set -e
# this script publishes the addon zip file to the add-on repository
VERSION=$1
REPO_URL=$2
REPO_FOLDER=release_repo
# check if action was triggered in a fork and avoid trying to push. FOR TESTING DISABLED
if [[ $GITHUB_REPOSITORY == "firsttris/plugin.video.sendtokodi" ]]; then
# clone repo
git clone https://$REPO_URL $REPO_FOLDER
# add the plugin zip file
mv plugin.video.sendtokodi-$VERSION.zip $REPO_FOLDER/plugin.video.sendtokodi/
# Update repository's addon.xml with the addon's addon.xml
$GITHUB_WORKSPACE/.github/scripts/update-repo-xml.py --repo-root $REPO_FOLDER --version $VERSION
cd $REPO_FOLDER
md5sum addon.xml > addon.xml.md5
# Add new addon zip file, the repo addon.xml, its md5 hash file and then commit and push
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "CI Update for $VERSION"
git push --force --quiet "https://firsttris:$TOKEN@$REPO_URL" master
else
echo "Not in the main repo, build will not be published."
fi