-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Set up automatic schema generation
- Loading branch information
1 parent
182c6bf
commit 50d769b
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: VHS Schema Generation | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- development | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
|
||
- name: Checkout VHS project | ||
uses: actions/checkout@v2 | ||
with: | ||
path: vhs | ||
persist-credentials: false | ||
|
||
- name: Install Schema Generator | ||
working-directory: ./vhs | ||
run: | | ||
composer require -n -o --no-progress typo3/fluid-schema-generator "^2.1" | ||
- name: Install XML Linter | ||
working-directory: ./vhs | ||
run: | | ||
sudo apt install libxml2-utils | ||
- name: Generate Schemata | ||
working-directory: ./vhs | ||
run: | | ||
mkdir -p ../schemas/fluidtypo3/vhs/latest | ||
./vendor/bin/generateschema FluidTYPO3\\\Vhs > ../schemas/fluidtypo3/vhs/latest/schema.xsd | ||
- name: Compare and Commit if changed | ||
working-directory: ./vhs | ||
continue-on-error: true | ||
run: | | ||
if [[ `diff ../schemas/fluidtypo3/vhs/latest/schema.xsd ./Resources/Private/Schemas/Vhs.xsd` != "" ]]; then | ||
xmllint --format ../schemas/fluidtypo3/vhs/latest/schema.xsd > ./Resources/Private/Schemas/Vhs.xsd | ||
git config user.name "FluidTYPO3 VHS" | ||
git config user.email "claus@namelesscoder.net" | ||
git add ./Resources/Private/Schemas/Vhs.xsd | ||
git commit -m '[TASK] Update XSD schema' | ||
git push https://${{ secrets.EXEMPT_PUSH_TOKEN }}@github.com/FluidTYPO3/vhs HEAD:development | ||
fi |