Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Sony Dualsense and configs #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Generate the documentation from the JSON Schemas

on:
push:
branches:
- main
- docs
jobs:
generate_doc:
name: Generate the documentation from the JSON Schemas
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -16,6 +14,10 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}.wiki
path: .wiki
- uses: actions/setup-python@v4
with:
python-version: "3.11"
Expand All @@ -28,27 +30,24 @@ jobs:
- name: Install json-schema-for-humans
run: pip install json-schema-for-humans

- name: Create documentation directory
run: mkdir -p _docs

- name: Generate the documentation
run: |
generate-schema-doc --config template_name=md_nested ./.schema/controller.json ./_docs/controller.md
generate-schema-doc --config template_name=md_nested ./.schema/manufacturer.json ./_docs/manufacturer.md
generate-schema-doc --config template_name=md_nested ./.schema/category.json ./_docs/category.md
generate-schema-doc --config template_name=md_nested ./.schema/controller.json "./.wiki/Controller Definition.md"
generate-schema-doc --config template_name=md_nested ./.schema/manufacturer.json "./.wiki/Manufacturer Definition.md"
generate-schema-doc --config template_name=md_nested ./.schema/category.json "./.wiki/Category Definition.md"

- name: Generate Conntroller List
run: |
python3 .utilities/generate_controller_tables.py

- run: git pull
- name: Commit files
run: |
cd .wiki
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add *
if ! git diff-index --quiet HEAD; then
git commit -m "Update documentation" -a
fi

- name: push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}
git push
30 changes: 15 additions & 15 deletions .github/workflows/validate-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@ on:
pull_request:
branches:
- main
name: Validate JSON

jobs:
validate:
name: Validate JSON Files against schemas
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Delete previous comment
uses: izhangzhihao/delete-comment@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_user_name: github-actions[bot]
issue_number: ${{ github.event.number }}
- uses: actions/checkout@v3
- name: Validate Category JSON
uses: dsanders11/[email protected]
Expand All @@ -31,9 +24,16 @@ jobs:
with:
schema: ".schema/controller.json"
files: "*/*/*/config.json"
- name: Comment PR
if: failure()
uses: thollander/[email protected]
with:
message: |
Validation of the JSON files has failed, please check the [Github Action log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see why
- name: Send status
if: ${{ success() }}
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"context": "Validate JSON Files against schemas",
"state": "success",
"description": "JSON Files are valid",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.schema/template.json
.schema/template.json
.schema/.json_schema.json
.wiki
1 change: 1 addition & 0 deletions .schema/category.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$id": "ControllerDatabase_category",
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/CategoryDefinition",
"definitions": {
Expand Down
9 changes: 7 additions & 2 deletions .schema/controller.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$id": "ControllerDatabase_controller",
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/ControllerDefinition",
"definitions": {
Expand Down Expand Up @@ -541,10 +542,14 @@
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
"type": "string",
"title": "Name"
},
"image": {
"type": "string"
"type": "string",
"pattern": "(.*)\\.(p|P)(n|N)(g|G)",
"title": "Image",
"description": "Name of a PNG image showing the mentionned variant\nThe image must be placed in the same folder as this config file\nNote: At least one of the variants must use the default `image.png` file"
}
},
"required": [
Expand Down
1 change: 1 addition & 0 deletions .schema/manufacturer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$id": "ControllerDatabase_manufacturer",
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/ManufacturerDefinition",
"definitions": {
Expand Down
21 changes: 21 additions & 0 deletions .utilities/consoles_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"dc": "Sega Dreamcast",
"n64": "Nintendo 64",
"nes": "Nintendo Entertainment System / Famicom",
"ngc": "Nintendo GameCube",
"nsw": "Nintendo Switch",
"ps1": "Sony PlayStation 1",
"ps2": "Sony PlayStation 2",
"ps3": "Sony PlayStation 3",
"ps4": "Sony PlayStation 4",
"ps5": "Sony PlayStation 5",
"saturn": "Sega Saturn",
"smd": "Sega Mega Drive / Sega Genesis",
"snes": "Super Nintendo Entertainment System / Super Famicom",
"wii": "Nintendo Wii",
"wiiu": "Nintendo Wii U",
"xb1": "Xbox One",
"xb360": "Xbox 360",
"xbox": "Xbox",
"xbs": "Xbox Series X|S"
}
Loading
Loading