diff --git a/.github/workflows/buf-ci.yaml b/.github/workflows/buf-ci.yaml new file mode 100644 index 0000000..6f57515 --- /dev/null +++ b/.github/workflows/buf-ci.yaml @@ -0,0 +1,18 @@ +name: Buf CI +on: + push: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + delete: +permissions: + contents: read + pull-requests: write +jobs: + buf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: bufbuild/buf-action@v0.1 + with: + token: ${{ secrets.BUF_TOKEN }} + version: 1.32.2 diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml deleted file mode 100644 index 402951d..0000000 --- a/.github/workflows/buf.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: buf -on: - push: -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: install - uses: actions/setup-go@v5 - with: - go-version: 1.21.x - - name: cache - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-registry-proto-ci-${{ hashFiles('**/Makefile') }} - restore-keys: ${{ runner.os }}-registry-proto-ci- - - name: Lint - run: | - make lint - breaking: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.32.0-beta.1 - - uses: bufbuild/buf-breaking-action@v1 - with: - against: buf.build/bufbuild/registry - push: - environment: production - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - needs: - - lint - - breaking - steps: - - uses: actions/checkout@v4 - - name: Install buf cli - uses: bufbuild/buf-setup-action@v1.32.0-beta.1 - with: - github_token: ${{ github.token }} - - uses: bufbuild/buf-push-action@v1 - with: - buf_token: ${{ secrets.BUF_TOKEN }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dac58cc..6570f3e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,13 +12,8 @@ jobs: - name: install uses: actions/setup-go@v5 with: - go-version: 1.21.x - - name: cache - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-registry-proto-ci-${{ hashFiles('**/Makefile') }} - restore-keys: ${{ runner.os }}-registry-proto-ci- + go-version: 1.22.x + cache-dependency-path: Makefile - name: make run: make - name: make checkgenerate diff --git a/Makefile b/Makefile index b0cba52..7a91d82 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ BIN := .tmp/bin export PATH := $(BIN):$(PATH) export GOBIN := $(abspath $(BIN)) -BUF_VERSION := v1.32.0-beta.1 +BUF_VERSION := 1.32.2 COPYRIGHT_YEARS := 2023-2024 .PHONY: help @@ -56,8 +56,8 @@ checkgenerate: $(BIN)/buf: Makefile @mkdir -p $(@D) - go install github.com/bufbuild/buf/cmd/buf@$(BUF_VERSION) + go install github.com/bufbuild/buf/cmd/buf@v$(BUF_VERSION) $(BIN)/license-header: Makefile @mkdir -p $(@D) - go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@$(BUF_VERSION) + go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v$(BUF_VERSION)