| 1 |
name: Increment version when languages are updated |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ Matrix, Nexus, Omega ] |
| 6 |
paths: |
| 7 |
- '**resource.language.**strings.po' |
| 8 |
|
| 9 |
jobs: |
| 10 |
default: |
| 11 |
if: github.repository == 'kodi-pvr/pvr.mediaportal.tvserver' |
| 12 |
runs-on: ubuntu-latest |
| 13 |
name: Increment add-on version when languages are updated |
| 14 |
|
| 15 |
steps: |
| 16 |
|
| 17 |
- name: Checkout Repository |
| 18 |
uses: actions/checkout@v4 |
| 19 |
with: |
| 20 |
fetch-depth: 0 |
| 21 |
path: ${{ github.event.repository.name }} |
| 22 |
|
| 23 |
- name: Checkout Scripts |
| 24 |
uses: actions/checkout@v4 |
| 25 |
with: |
| 26 |
fetch-depth: 0 |
| 27 |
repository: xbmc/weblate-supplementary-scripts |
| 28 |
path: scripts |
| 29 |
|
| 30 |
- name: Set up Python |
| 31 |
uses: actions/setup-python@v5 |
| 32 |
with: |
| 33 |
python-version: '3.9' |
| 34 |
|
| 35 |
- name: Get changed files |
| 36 |
uses: trilom/[email protected] |
| 37 |
|
| 38 |
- name: Increment add-on version |
| 39 |
run: | |
| 40 |
python3 ../scripts/binary/increment_version.py $HOME/files.json -c -n |
| 41 |
working-directory: ${{ github.event.repository.name }} |
| 42 |
|
| 43 |
- name: Install dependencies |
| 44 |
run: | |
| 45 |
sudo apt-get update |
| 46 |
sudo apt-get install libxml2-utils xmlstarlet |
| 47 |
|
| 48 |
- name: Get required variables |
| 49 |
id: required-variables |
| 50 |
run: | |
| 51 |
version=$(xmlstarlet fo -R "$(find . -name addon.xml.in)" | xmlstarlet sel -t -v 'string(/addon/@version)') |
| 52 |
echo "version=$version" >> $GITHUB_OUTPUT |
| 53 |
working-directory: ${{ github.event.repository.name }} |
| 54 |
|
| 55 |
- name: Create PR for incrementing add-on versions |
| 56 |
uses: peter-evans/[email protected] |
| 57 |
with: |
| 58 |
commit-message: Add-on version incremented to ${{ steps.required-variables.outputs.version }} from Weblate |
| 59 |
title: Add-on version incremented to ${{ steps.required-variables.outputs.version }} from Weblate |
| 60 |
body: Add-on version incremented triggered by ${{ github.sha }} |
| 61 |
branch: inc-ver |
| 62 |
delete-branch: true |
| 63 |
path: ./${{ github.event.repository.name }} |