-
Notifications
You must be signed in to change notification settings - Fork 32
49 lines (42 loc) · 1.42 KB
/
main.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
name: Zip and Release
on:
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: get addon version
run: |
ver=`cat addon.xml |grep -oP 'name="ZiMuKuX" version="\K[^"]*'`
echo ZIMUKUX_VER=$ver >> $GITHUB_ENV
- uses: mukunku/[email protected]
id: checkTag
with:
tag: v${{ env.ZIMUKUX_VER }}
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_ACTIONS }}
- name: zip it
if: ${{ steps.checkTag.outputs.exists == 'false' }}
run: |
for file in .[^.]*; do rm -rf "$file"; done
cd ..
mv zimuku_for_kodi/ script.subtitles.zimukux/
zip -r -qq script.subtitles.zimukux-${{ env.ZIMUKUX_VER }}.zip script.subtitles.zimukux/
mv script.subtitles.zimukux-${{ env.ZIMUKUX_VER }}.zip script.subtitles.zimukux/
mv script.subtitles.zimukux/ zimuku_for_kodi/
cd zimuku_for_kodi
sed -e '/^$/,$d' CHANGES > changelog.txt
- name: release
if: ${{ steps.checkTag.outputs.exists == 'false' }}
uses: ncipollo/release-action@v1
with:
tag: v${{ env.ZIMUKUX_VER }}
commit: main
bodyFile: changelog.txt
artifacts: script.subtitles.zimukux-${{ env.ZIMUKUX_VER }}.zip
token: ${{ secrets.PAT_FOR_ACTIONS }}