-
Notifications
You must be signed in to change notification settings - Fork 145
26 lines (23 loc) · 1.1 KB
/
version_check.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
name: Version Check
on:
push:
paths:
- 'com.woltlab.wcf/package.xml'
- 'wcfsetup/install/files/lib/system/WCF.class.php'
permissions:
contents: read
jobs:
wcf_version:
name: "Check that WCF_VERSION is in sync"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
set -x
PACKAGE_VERSION="$(sed '/<version>/!d;s!^.*<version>!!;s!</version>$!!' com.woltlab.wcf/package.xml)"
WCF_VERSION="$(sed -r '/WCF_VERSION/!d;s!^.?define..WCF_VERSION., .!!;s!..;$!!' wcfsetup/install/files/lib/system/WCF.class.php)"
if [ "$PACKAGE_VERSION" != "$WCF_VERSION" ]; then
echo "::error file=com.woltlab.wcf/package.xml,line=$(awk '/<version>/{print NR}' com.woltlab.wcf/package.xml),title=Mismatching WCF version::This version $PACKAGE_VERSION does not match WCF.class.php."
echo "::error file=wcfsetup/install/files/lib/system/WCF.class.php,line=$(awk '/WCF_VERSION/{print NR}' wcfsetup/install/files/lib/system/WCF.class.php),title=Mismatching WCF version::This version $WCF_VERSION does not match package.xml."
exit 1
fi