Skip to content

Commit a6cb4c0

Browse files
authored
Add GH action to publish proto files to BSR (cosmos#753)
GH Action includes: - check for lint errors - check for backward compatibility breaking changes Migrated buf config files from v1beta1 to v1 using command: 'buf config migrate-v1beta1' (https://docs.buf.build/configuration/v1beta1-migration-guide)
1 parent 08b00b9 commit a6cb4c0

File tree

4 files changed

+83
-19
lines changed

4 files changed

+83
-19
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Proto Buf Publishing - Action
2+
# Protobuf runs buf (https://buf.build/) push updated proto files to https://buf.build/cosmwasm/wasmd
3+
# This workflow is only run when a .proto file has been changed
4+
on:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- 'proto/**'
10+
11+
jobs:
12+
push:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: bufbuild/[email protected]
17+
18+
# lint checks
19+
- uses: bufbuild/buf-lint-action@v1
20+
with:
21+
input: 'proto'
22+
23+
# backward compatibility breaking checks
24+
- uses: bufbuild/buf-breaking-action@v1
25+
with:
26+
input: 'proto'
27+
against: 'https://github.com/CosmWasm/wasmd.git#branch=master'
28+
29+
# publish proto files
30+
- uses: bufbuild/buf-push-action@v1
31+
with:
32+
input: 'proto'
33+
buf_token: ${{ secrets.BUF_TOKEN }}

buf.work.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
2+
# remove this comment when you're finished.
3+
#
4+
# This workspace file points to the roots found in your
5+
# previous "buf.yaml" configuration.
6+
version: v1
7+
directories:
8+
- proto
9+
- third_party/proto

proto/buf.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
2+
# remove this comment when you're finished.
3+
#
4+
# This module represents the "proto" root found in
5+
# the previous configuration.
6+
version: v1
7+
breaking:
8+
use:
9+
- FILE
10+
lint:
11+
use:
12+
- DEFAULT
13+
- COMMENTS
14+
- FILE_LOWER_SNAKE_CASE
15+
except:
16+
- UNARY_RPC
17+
- COMMENT_FIELD
18+
- SERVICE_SUFFIX
19+
- PACKAGE_VERSION_SUFFIX
20+
- RPC_REQUEST_STANDARD_NAME
21+
- PACKAGE_DIRECTORY_MATCH

buf.yaml third_party/proto/buf.yaml

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
version: v1beta1
2-
1+
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
2+
# remove this comment when you're finished.
3+
#
4+
# This module represents the "third_party/proto" root found in
5+
# the previous configuration.
6+
version: v1
37
build:
4-
roots:
5-
- proto
6-
- third_party/proto
78
excludes:
8-
- third_party/proto/google/protobuf
9+
- google/protobuf
10+
breaking:
11+
use:
12+
- FILE
13+
ignore:
14+
- confio
15+
- cosmos
16+
- cosmos_proto
17+
- gogoproto
18+
- google
19+
- ibc
20+
- tendermint
921
lint:
1022
use:
1123
- DEFAULT
@@ -19,21 +31,10 @@ lint:
1931
- RPC_REQUEST_STANDARD_NAME
2032
- PACKAGE_DIRECTORY_MATCH
2133
ignore:
34+
- confio
2235
- cosmos
23-
- ibc
24-
- tendermint
25-
- gogoproto
2636
- cosmos_proto
37+
- gogoproto
2738
- google
28-
- confio
29-
breaking:
30-
use:
31-
- FILE
32-
ignore:
33-
- cosmos
3439
- ibc
3540
- tendermint
36-
- gogoproto
37-
- cosmos_proto
38-
- google
39-
- confio

0 commit comments

Comments
 (0)