Skip to content

Commit

Permalink
docs: validate jsonschema
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 2, 2024
1 parent a117582 commit c6f2eb7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: generate
on:
push:
branches:
- 'main'
- "main"
paths:
- '.github/workflows/generate.yml'
- 'www/*'
- 'cmd/*'
- 'internal/cmd/*'
- 'files/*'
- ".github/workflows/generate.yml"
- "www/*"
- "cmd/*"
- "internal/cmd/*"
- "files/*"
workflow_dispatch:

jobs:
Expand All @@ -23,10 +23,13 @@ jobs:
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: task docs:generate
- run: "go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest"
- run: task docs:releases
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- run: task docs:generate
- run: task schema:generate
- run: task schema:validate
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "docs: update cmd docs"
Expand Down
17 changes: 16 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,29 @@ tasks:
cmds:
- task: ci

schema:generate:
desc: Generate JSONSchema
cmds:
- go run ./cmd/nfpm/ schema -o ./www/docs/static/schema.json
sources:
- nfpm.go
generates:
- ./www/docs/static/schema.json

schema:validate:
desc: Validate JSONSchema
cmds:
- jv ./www/docs/static/schema.json
sources:
- ./www/docs/static/schema.json

docs:generate:
desc: Generate docs
cmds:
- ./scripts/cmd_docs.sh
sources:
- cmd/*.go
- files/*.go
- nfpm.go
- ./scripts/cmd_docs.sh
- CONTRIBUTING.md
generates:
Expand Down
1 change: 0 additions & 1 deletion scripts/cmd_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fi
mkdir -p www/docs/cmd
rm -rf www/docs/cmd/*.md
go run ./cmd/nfpm docs
go run ./cmd/nfpm schema -o ./www/docs/static/schema.json

"$SED" \
-i'' \
Expand Down

0 comments on commit c6f2eb7

Please sign in to comment.