-
Notifications
You must be signed in to change notification settings - Fork 161
70 lines (61 loc) · 1.95 KB
/
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
# Release script for Alfa Addon
name: release
on:
push:
branches:
- master
- devel
paths:
- '.github/workflows/release.yml'
workflow_dispatch:
# Set permissions for GitHub key
permissions: write-all
jobs:
deploy:
name: Deploy Job
runs-on: ubuntu-latest
if: ${{ github.event.head_commit.message == 'release' || github.event_name == 'workflow_dispatch'}}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_USER_NAME: Alfa Addon
GIT_USER_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_REPOSITORY: alfa-addon/addon
ADDON_REPOSITORY: alfa-repo
ADDON: 'plugin.video.alfa'
steps:
- name: Installing environment tools
run: sudo snap install --classic hub
- name: Configure Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Checkout repo
uses: actions/checkout@v2
- name: Start deployment
run: |
# Deploying
echo "Entering Git repo directory"
cd ${{ github.workspace }}
echo "Downloading deployment script"
wget https://raw.githubusercontent.com/alfa-addon/travis_scripts/master/deploy_addon.py
echo "pip-installing lxml"
pip install lxml
echo "Preparing ZIP"
python deploy_addon.py -z
echo "- Deploying to Kodi repository"
python deploy_addon.py -r
- name: Release on GitHub
run: |
echo "Entering Git repo directory"
cd ${{ github.workspace }}
echo "Getting assets"
assets=()
for asset in ./*.zip; do
assets+=("-a" "${asset}")
done
echo "Getting add-on version"
python deploy_addon.py -v
git_tag="$(cat version)"
echo "Releasing the kraken"
hub release create "${assets[@]}" -m "Alfa-v${git_tag}" "Alfa-v${git_tag}"