From 30aab95555bf25a8e4fa322202a2ffc0c57b9709 Mon Sep 17 00:00:00 2001 From: nfel Date: Thu, 6 Aug 2026 21:18:06 +0330 Subject: [PATCH] fix(cicd): install buf from GitHub releases instead of broken buf-bin repo --- .gitea/actions/build-proto/action.yml | 26 ++++++++++++++++---------- .gitea/workflows/ci-stage.yaml | 13 ++++++++++++- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.gitea/actions/build-proto/action.yml b/.gitea/actions/build-proto/action.yml index eea419f..733cfd9 100644 --- a/.gitea/actions/build-proto/action.yml +++ b/.gitea/actions/build-proto/action.yml @@ -1,24 +1,30 @@ name: Build Proto description: Install buf CLI, run buf lint and buf build inputs: - buf_ref: - description: Git ref of actions/buf-bin to checkout + buf_version: + description: Buf CLI version to install required: false - default: "main" + default: "1.72.0" runs: using: composite steps: - - name: Checkout Buf CLI - uses: https://git.darano.ir/actions/checkout@v5 - with: - repository: actions/buf-bin - ref: ${{ inputs.buf_ref }} - path: buf-bin - name: Setup Buf CLI shell: bash + env: + BUF_VERSION: ${{ inputs.buf_version }} run: | - cp buf-bin/buf /usr/local/bin/buf + ARCH="$(uname -m)" + case "$ARCH" in + x86_64) BIN="buf-Linux-x86_64" ;; + aarch64) BIN="buf-Linux-aarch64" ;; + arm64) BIN="buf-Darwin-arm64" ;; + *) BIN="buf-Linux-x86_64" ;; + esac + curl -sSL "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/${BIN}.tar.gz" -o buf.tar.gz + tar -xzf buf.tar.gz + cp buf /usr/local/bin/buf chmod +x /usr/local/bin/buf + rm -rf buf buf.tar.gz - name: Lint shell: bash run: buf lint diff --git a/.gitea/workflows/ci-stage.yaml b/.gitea/workflows/ci-stage.yaml index 86e72eb..d264464 100644 --- a/.gitea/workflows/ci-stage.yaml +++ b/.gitea/workflows/ci-stage.yaml @@ -24,8 +24,19 @@ jobs: uses: ./.gitea/actions/setup-mirrors - name: Setup Buf CLI run: | - cp buf-bin/buf /usr/local/bin/buf + BUF_VERSION=1.72.0 + ARCH="$(uname -m)" + case "$ARCH" in + x86_64) BIN="buf-Linux-x86_64" ;; + aarch64) BIN="buf-Linux-aarch64" ;; + arm64) BIN="buf-Darwin-arm64" ;; + *) BIN="buf-Linux-x86_64" ;; + esac + curl -sSL "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/${BIN}.tar.gz" -o buf.tar.gz + tar -xzf buf.tar.gz + cp buf /usr/local/bin/buf chmod +x /usr/local/bin/buf + rm -rf buf buf.tar.gz buf-bin - name: Lint run: buf lint - name: Build