diff --git a/.github/workflows/validate-config.yml b/.github/workflows/validate-config.yml new file mode 100644 index 0000000..5765e01 --- /dev/null +++ b/.github/workflows/validate-config.yml @@ -0,0 +1,22 @@ +name: Validate Configuration + +on: + pull_request: + paths: + - 'config/target-config.json' + - 'schema/target-config.schema.json' + +jobs: + validate-json: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: pip install check-jsonschema + + - name: Validate JSON + run: | + check-jsonschema --schemafile schema/target-config.schema.json config/target-config.json diff --git a/config/target-config.json b/config/target-config.json index 6e3903f..9a31c7c 100755 --- a/config/target-config.json +++ b/config/target-config.json @@ -1,7 +1,7 @@ [ { "name": "edge-pi-zero", - "version": "1.5.3", + "version": "1.6.0", "reference": "2024-07-05-raspios-bullseye", "sources": [ { @@ -41,6 +41,10 @@ "package": "mrhat-battery-simple", "file_url": "https://github.com/EffectiveRange/drv-battery/releases/download/v0.1.0/mrhat-battery-simple_0.1.0-1_all.deb" }, + { + "package": "python3-mrhat-daemon", + "file_url": "https://github.com/EffectiveRange/mrhat-daemon/releases/download/v1.0.0/python3-mrhat-daemon_1.0.0_all.deb" + }, { "package": "filebeat", "version": "8.12.2", @@ -50,13 +54,14 @@ "boot_config": [ "enable_uart=1", "dtoverlay=mrhat-battery-simple", - "dtoverlay=mrhat-bq25622:ce_override=true;battery_diag=true", + "dtoverlay=mrhat-bq25622", "dtoverlay=mrhat-platform", "dtoverlay=mrhat-rx8130", "dtoverlay=googlevoicehat-soundcard" ], "first_boot": [ - "depmod" + "depmod", + "reboot" ], "post_install": [ "raspi-config nonint do_wifi_country HU", diff --git a/schema/target-config.schema.json b/schema/target-config.schema.json new file mode 100644 index 0000000..352efcf --- /dev/null +++ b/schema/target-config.schema.json @@ -0,0 +1,109 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "source": { + "type": "string" + }, + "key_id": { + "type": "string" + }, + "key_file": { + "type": "string" + }, + "key_server": { + "type": "string" + } + }, + "required": ["name", "source", "key_id", "key_file"] + } + }, + "packages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "package": { + "type": "string" + }, + "release": { + "type": "object", + "properties": { + "owner": { + "type": "string" + }, + "repo": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "matcher": { + "type": "string" + } + }, + "required": ["owner", "repo", "matcher"] + }, + "version": { + "type": "string" + }, + "file_url": { + "type": "string" + } + }, + "required": ["package"] + } + }, + "boot_cmdline": { + "type": "array", + "items": { + "type": "string" + } + }, + "boot_config": { + "type": "array", + "items": { + "type": "string" + } + }, + "first_boot": { + "type": "array", + "items": { + "type": "string" + } + }, + "pre_install": { + "type": "array", + "items": { + "type": "string" + } + }, + "post_install": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "version", "reference", "packages"] + } +}