forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (167 loc) · 4.95 KB
/
protobuf.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Protobuf
on:
push:
tags:
- v*
branches:
- master
paths:
- "api/**"
- "Makefile"
- "js/Makefile"
- "go/Makefile"
- "config/**"
- "docs/Makefile"
- ".github/workflows/protobuf.yml"
- "js/packages/berty-i18n/locale/en/messages.json"
- "tool/generate-i18n-testlang"
- "**/gen.sum"
- "**.pb.go"
- "**.gen.go"
- "**.gen.graphql"
- "**.gen.js"
- "**.gen.ts"
- "**.gen.tsx"
- "**.gen.yml"
- "**.pb.d.ts"
- "**.pb.go"
- "**.pb.js"
- "**/pb_test.go"
- "**/docs/*/api.md"
- "**/gen.sum"
- "**/go.mod"
- "**/go.sum"
- "**/yarn.lock"
- "**/package.json"
- "**/Podfile.lock"
pull_request:
paths:
- "api/**"
- "Makefile"
- "js/Makefile"
- "go/Makefile"
- "config/**"
- "docs/Makefile"
- ".github/workflows/protobuf.yml"
- "js/packages/berty-i18n/locale/en/messages.json"
- "tool/generate-i18n-testlang"
- "**/gen.sum"
- "**.pb.go"
- "**.gen.go"
- "**.gen.graphql"
- "**.gen.js"
- "**.gen.ts"
- "**.gen.tsx"
- "**.gen.yml"
- "**.pb.d.ts"
- "**.pb.go"
- "**.pb.js"
- "**/pb_test.go"
- "**/docs/*/api.md"
- "**/gen.sum"
- "**/go.mod"
- "**/go.sum"
- "**/yarn.lock"
- "**/package.json"
- "**/Podfile.lock"
jobs:
gen-go-and-docs:
runs-on: ubuntu-latest
container: bertytech/protoc:27
steps:
- name: checkout
uses: actions/[email protected]
- name: unshallow
run: git fetch --prune --unshallow
- name: remove lock files
run: find . -name gen.sum ! -path './js/*' -delete
- name: preload common deps
run: go mod download
- name: generating docs/
run: |
cd docs
make generate_local
- name: generating go/
run: |
cd go
make generate_local
cd ..
git checkout go.mod go.sum
- name: check diff
run: |
git status | cat
git diff -w | cat
git diff-index -w --quiet HEAD --
- name: install jq
run: |
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /usr/local/bin/jq
chmod +x /usr/local/bin/jq
- name: prepare openapi documentation
run: cd docs && make openapi.prepare
- name: install apiary
run: apk --no-cache add ruby-dev g++ && gem install apiaryio
- name: upload API docs to apiary.io
env:
APIARY_API_KEY: "${{ secrets.APIARY_API_KEY }}"
if: ${{ env.APIARY_API_KEY != 0 }}
run: |
apiary publish --api-name=bertyprotocol --path="docs/.tmp/openapi/bertyprotocol.swagger.json" || true
apiary publish --api-name=bertymessenger --path="docs/.tmp/openapi/bertymessenger.swagger.json" || true
#- name: deploy protocol API documentation on bump.sh
# uses: bump-sh/[email protected]
# env:
# BUMP_TOKEN: "${{ secrets.BUMP_TOKEN }}"
# if: ${{ env.BUMP_TOKEN != 0 }}
# with:
# id: 6eb1bb1e-c65d-4b73-a8c4-0e545742f6db
# token: ${{ secrets.BUMP_TOKEN }}
# file: docs/.tmp/openapi/bertyprotocol.swagger.json
#- name: deploy messenger API documentation on bump.sh
# uses: bump-sh/[email protected]
# env:
# BUMP_TOKEN: "${{ secrets.BUMP_TOKEN }}"
# if: ${{ env.BUMP_TOKEN != 0 }}
# with:
# id: f3c48f1c-2b5b-4d3f-9ddb-40f6cf09b905
# token: ${{ secrets.BUMP_TOKEN }}
# file: docs/.tmp/openapi/bertymessenger.swagger.json
gen-js:
strategy:
matrix:
node: [14.x]
runs-on: ubuntu-latest
container: bertytech/protoc:27
steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
- run: make gen.clean
working-directory: js
- name: Cache Node.js modules
uses: actions/[email protected]
with:
path: js/node_modules
key: ${{ runner.OS }}-genjs-${{ matrix.node}}-v2-${{ hashFiles('js/yarn.lock') }}
restore-keys: ${{ runner.OS }}-genjs-${{ matrix.node}}-v2-
- name: "Fetch deps"
# FIXME: find a way of only downloading the required packages or install them directly in the bertytech/protoc image
run: make node_modules
working-directory: js
env:
CI: true
- name: Preload Go vendors
run: go mod download
- run: make _gen.pbjs
working-directory: js
- run: make _write_gen_sum
working-directory: js
- run: rm -f gen.sum && make generate
working-directory: js
- name: check diff
run: |
go mod tidy
git status | cat
git diff -w | cat
git diff-index -w --quiet HEAD --