-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Designate buf module to push to registry
- Loading branch information
1 parent
a4a7c0c
commit 1b2d307
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_requests: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^1.21' | ||
|
||
- name: install buf | ||
run: make bin/buf | ||
|
||
- name: login to BSR | ||
env: | ||
BUF_USER: ${{ vars.BUF_USER }} | ||
BUF_TOKEN: ${{ secrets.BUF_TOKEN }} | ||
run: | | ||
echo "$BUF_TOKEN" | bin/buf registry login --username "$BUF_USER" --token-stdin | ||
- name: publish to BSR main | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: bin/buf push -v src | ||
|
||
|
||
- name: publish to BSR branch | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
run: bin/buf push -v --branch "$BRANCH_NAME" src | ||
|
||
- name: logout BSR | ||
run: bin/buf registry logout | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ $(BIN)/gofumpt: Makefile | $(BIN) | |
$(TOOL_INSTALL) mvdan.cc/[email protected] | ||
|
||
$(BIN)/buf: Makefile | $(BIN) | ||
$(TOOL_INSTALL) github.com/bufbuild/buf/cmd/buf@v1.26.1 | ||
$(TOOL_INSTALL) github.com/bufbuild/buf/cmd/buf@v1.28.1 | ||
|
||
$(BIN)/yq: Makefile | $(BIN) | ||
$(TOOL_INSTALL) github.com/mikefarah/yq/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: v1 | ||
name: buf.build/planetscale/vitess | ||
breaking: | ||
use: | ||
- FILE | ||
lint: | ||
use: | ||
- DEFAULT |