release #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}" |