Skip to content

Commit 49e6013

Browse files
committed
[TASK] Set up automatic schema generation
1 parent 182c6bf commit 49e6013

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/generate-xsd.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: VHS Schema Generation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- development
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
steps:
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '7.4'
19+
20+
- name: Checkout VHS project
21+
uses: actions/checkout@v2
22+
with:
23+
path: vhs
24+
persist-credentials: false
25+
26+
- name: Install Schema Generator
27+
working-directory: ./vhs
28+
run: |
29+
composer require -n -o --no-progress typo3/fluid-schema-generator "^2.1"
30+
31+
- name: Install XML Linter
32+
working-directory: ./vhs
33+
run: |
34+
sudo apt install libxml2-utils
35+
36+
- name: Generate Schemata
37+
working-directory: ./vhs
38+
run: |
39+
mkdir -p ../schemas/fluidtypo3/vhs/latest
40+
./vendor/bin/generateschema FluidTYPO3\\\Vhs > ../schemas/fluidtypo3/vhs/latest/schema.xsd
41+
42+
- name: Compare and Commit if changed
43+
working-directory: ./vhs
44+
run: |
45+
if [[ `diff ../schemas/fluidtypo3/vhs/latest/schema.xsd ./Resources/Private/Schemas/Vhs.xsd` != "" ]]; then
46+
xmllint --format ../schemas/fluidtypo3/vhs/latest/schema.xsd > ./Resources/Private/Schemas/Vhs.xsd
47+
git config user.name "FluidTYPO3 VHS"
48+
git config user.email "[email protected]"
49+
git add ./Resources/Private/Schemas/Vhs.xsd
50+
git commit -m '[TASK] Update XSD schema'
51+
git push https://${{ secrets.EXEMPT_PUSH_TOKEN }}@github.com/FluidTYPO3/vhs HEAD:development
52+
fi

0 commit comments

Comments
 (0)