-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (42 loc) · 1.32 KB
/
json-schemas.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: "JSON Schemas"
on:
push:
paths:
- 'models.proto'
branches:
- main
workflow_dispatch:
jobs:
json-schemas:
runs-on: ubuntu-latest
steps:
- name: Clone any-block
uses: actions/checkout@v3
with:
repository: anyproto/any-block
token: ${{ secrets.ANY_CLA_TOKEN }}
# install go, protoc, and https://github.com/chrusty/protoc-gen-jsonschema
- name: Install go
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Install protoc
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install protoc-gen-jsonschema
run: |
go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@latest
# generate json schemas
- name: Generate JSON Schemas
run: |
mkdir -p json
mkdir -p json/models
protoc --jsonschema_out=./json/models --proto_path=. models.proto
# commit and push changes
- name: Commit and push changes
run: |
git config --global user.email "association@anytype.io"
git config --global user.name "Any Association"
git add .
git commit -m "Update JSON schemas"
git push origin main