forked from pinterf/assrender
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (82 loc) · 2.87 KB
/
check-smp.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update data
on:
push:
branches:
- main
schedule:
- cron: '0 5 * * *'
workflow_dispatch: #
env:
submodule_owner: ShiftMediaProject
submodule_folder: SMP
jobs:
check_smp:
runs-on: ubuntu-latest
strategy:
matrix:
submodule:
- fontconfig
- freetype2
- fribidi
- harfbuzz
- libass
- libiconv
- liblzma
- libxml2
- zlib
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: master
- name: Set submodule current
run: |
git submodule update --init --recursive "${{ env.submodule_folder }}/${{ matrix.submodule }}"
cd ${{ env.submodule_folder }}/${{ matrix.submodule }}
echo SUBMODULE_NAME=${{ matrix.submodule }} >> $GITHUB_ENV
echo SUBMODULE_REV=$(git describe --tags --first-parent --abbrev=7 --long --dirty) >> $GITHUB_ENV
echo SUBMODULE_SHA=$(git rev-parse HEAD) >> $GITHUB_ENV
- name: Get submodule current remote
id: current
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repo: ${{ env.submodule_owner }}/${{ matrix.submodule }}
commitSha: ${{ env.SUBMODULE_SHA }}
doNotFailIfNotFound: true
- name: Get submodule latest remote
id: latest
uses: cardinalby/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repo: ${{ env.submodule_owner }}/${{ matrix.submodule }}
latest: true
prerelease: false
doNotFailIfNotFound: true
- name: Set submodule current remote
if: steps.current.outputs.tag_name != ''
run: echo SUBMODULE_REV=${{ steps.current.outputs.tag_name }} >> $GITHUB_ENV
- name: Check if need update
if: |
steps.latest.outputs.tag_name != '' &&
steps.current.outputs.tag_name == '' ||
steps.latest.outputs.tag_name != '' &&
steps.current.outputs.tag_name != steps.latest.outputs.tag_name
run: |
cd ${{ env.submodule_folder }}/${{ matrix.submodule }}
git checkout ${{ steps.latest.outputs.tag_name }}
echo NEED_UPDATE=1 >> $GITHUB_ENV
- name: Run update
if: ${{ env.NEED_UPDATE }} == '1'
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update ${{ matrix.submodule }} to ${{ steps.latest.outputs.tag_name }}
branch: submodule-update-${{ matrix.submodule }}
base: master
delete-branch: true
title: Update ${{ matrix.submodule }} (${{ env.SUBMODULE_REV }} to ${{ steps.latest.outputs.tag_name }})
body: |
Update ${{ matrix.submodule }} to ${{ steps.latest.outputs.tag_name }}
Current: ${{ env.SUBMODULE_REV }}