Skip to content

Commit

Permalink
add icon and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
siku2 committed Mar 1, 2020
1 parent 6e82397 commit f19922a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/addon-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on: [push]

jobs:
kodi-addon-checker:
runs-on: ubuntu-latest
name: Kodi addon checker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Kodi addon checker validation
id: kodi-addon-checker
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/addon-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Addon release

on:
push:
tags:
- "v*"

jobs:
release:
name: Create addon release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build addon
id: build_addon
run: |
source tools/create-release.sh
echo "::set-output name=name::${ZIP_NAME}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.build_addon.outputs.name }}
asset_name: ${{ steps.build_addon.outputs.name }}
asset_content_type: application/zip
6 changes: 3 additions & 3 deletions addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Skip YouTube in-video sponsors</summary>
<description lang="en_GB">
SponsorBlock is a crowdsourced project to skip sponsor segments in YouTube videos.
Users submit when a sponsor happens and the add-on automatically skips sponsors it knows about.
SponsorBlock is a crowdsourced project to skip sponsor segments in YouTube videos.
Users submit when a sponsor happens and the add-on automatically skips sponsors it knows about.
</description>
<platform>all</platform>
<license>MIT</license>
<source>https://github.com/siku2/script.service.sponsorblock</source>
<assets>
<!--TODO-->
<icon>resources/icon.png</icon>
</assets>
</extension>
</addon>
Binary file added resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions tools/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ echo "creating release version $ADDON_VERSION for addon $ADDON_ID"

function create_tempdir() {
local work_dir

work_dir=$(mktemp --directory)
if [[ ! "$work_dir" || ! -d "$work_dir" ]]; then
exit_with_error "could not create temp dir"
Expand All @@ -46,9 +45,9 @@ cp -rt "$dir" addon.xml ./*.py resources

echo "zipping addon"

zip_name="$ADDON_ID-$ADDON_VERSION.zip"
ZIP_NAME="$ADDON_ID-$ADDON_VERSION.zip"
pushd "$WORK_DIR" >/dev/null
zip -qr "$zip_name" "$ADDON_ID"
zip -qr "$ZIP_NAME" "$ADDON_ID"
popd >/dev/null

mv "$WORK_DIR/$zip_name" ./
mv "$WORK_DIR/$ZIP_NAME" ./

0 comments on commit f19922a

Please sign in to comment.