init: integrate MusicOCR workspace base
This commit is contained in:
parent
c564f1417c
commit
1d81a4778d
|
|
@ -0,0 +1,25 @@
|
|||
name: Backup Data Repo
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 2 * * *"
|
||||
|
||||
jobs:
|
||||
backup:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Create archive
|
||||
run: |
|
||||
tar -czf musicocr-data-repo.tgz projects campaigns manifests .gitattributes
|
||||
|
||||
- name: Upload archive artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: musicocr-data-repo-backup
|
||||
path: musicocr-data-repo.tgz
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
name: Validate Data Repo
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Validate JSON files
|
||||
run: |
|
||||
python - <<'PY'
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
json_files = list(Path(".").rglob("*.json"))
|
||||
bad = []
|
||||
for path in json_files:
|
||||
try:
|
||||
json.loads(path.read_text(encoding="utf-8"))
|
||||
except Exception as exc:
|
||||
bad.append(f"{path}: {exc}")
|
||||
|
||||
if bad:
|
||||
raise SystemExit("Invalid JSON files:\n" + "\n".join(bad))
|
||||
|
||||
print(f"Validated {len(json_files)} JSON files.")
|
||||
PY
|
||||
|
||||
- name: Check required top-level folders
|
||||
run: |
|
||||
test -d projects
|
||||
test -d manifests
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"schema_version": "1.0",
|
||||
"users": {
|
||||
"admin@example.org": {
|
||||
"role": "admin",
|
||||
"github_logins": ["komisla"],
|
||||
"all_projects": true,
|
||||
"can_create_projects": true
|
||||
},
|
||||
"reviewer@example.org": {
|
||||
"role": "viewer",
|
||||
"projects": [
|
||||
{
|
||||
"name": "Bach-Singet-dem-Herrn",
|
||||
"access": "read"
|
||||
}
|
||||
]
|
||||
},
|
||||
"annotator@example.org": {
|
||||
"role": "editor",
|
||||
"projects": [
|
||||
{
|
||||
"name": "Bach-Singet-dem-Herrn",
|
||||
"access": "write",
|
||||
"pages": [1, 2, 3],
|
||||
"sections": ["alto", "tenor"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"schema_version": "1.0",
|
||||
"users": {}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"schema_version": "1.0",
|
||||
"repo_type": "musicocr_data_repo",
|
||||
"projects_root": "projects",
|
||||
"campaigns_root": "campaigns",
|
||||
"access_control_file": "manifests/access_control.json"
|
||||
}
|
||||
Loading…
Reference in New Issue