Install and setup buf for use in other actions.
Refer to the action.yml to see all of the action parameters.
If version
is unspecified, the default value is set to the latest buf
version:
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.5.0
- run: buf --version
If you want to pin to a specific version, vou can explicitly set it like so:
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.5.0
with:
version: '1.0.0-rc1'
- run: buf --version
If you'd like to resolve the latest release from GitHub, you can specify latest
,
but this is not recommended:
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.5.0
with:
version: 'latest'
- run: buf --version
The buf-setup
action is commonly used by the other buf
actions,
such as buf-breaking, buf-lint, and buf-push.
In most cases, you don't need to install protoc
for Buf's GitHub Actions, but
some protoc
plugins are built-in to the compiler itself. If you need to execute any of
protoc-gen-{cpp,csharp,java,js,objc,php,python,ruby,kotlin}
, then you'll need to install
protoc
alongside buf
. In these cases, buf
actually executes protoc
as a plugin,
but continues to use its own internal compiler.
The buf-setup-action
won't install protoc
for you, but there are other options you can
use, such as setup-protoc. For clarity, you can configure it alongside buf
like so:
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.5.0
- uses: arduino/setup-protoc@v1