-
Notifications
You must be signed in to change notification settings - Fork 27
27 lines (27 loc) · 1.12 KB
/
qt-patches-updater.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
name: Update Qt patches
on: pull_request
jobs:
update-qt-patches:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'flathubbot'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
submodules: true
- name: Update Qt patches
run: |
QT=$(yq '.modules[] | select(.name == "qtbase").sources[0].url' org.telegram.desktop.yml | sed -r 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
pushd desktop-app-patches > /dev/null
repo=$(git remote get-url origin | sed -r 's@^https://github.com/(.*)\.git$@\1@')
git fetch
git checkout origin/master
commit=$(git rev-parse --short HEAD)
popd > /dev/null
for i in desktop-app-patches/*_${QT}; do
./gen-patchset.py -o $(basename $i | sed -r "s/_${QT}//").json $i
done
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add .
git diff --staged --quiet || (git commit -m "Update Qt patches to $repo@$commit" && git push)