From 787cf4b8ee22fe9206da0b1b811e9351170f07e6 Mon Sep 17 00:00:00 2001 From: tidex <46107860+tidexe@users.noreply.github.com> Date: Tue, 25 Feb 2025 22:41:34 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E4=BD=BF=E7=94=A8=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=9B=BF=E4=BB=A3=E7=9F=A9=E9=98=B5=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E4=B8=AD=E7=9A=84=E7=9B=AE=E6=A0=87=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 matrix.target_arch 替换为 fromJson(env.TARGET_ARCH) - 更新构建和上传/下载工件的步骤以使用新的环境变量 - 删除冗余的矩阵配置,简化工作流结构 --- .github/workflows/build-release.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 58e589c4..eaabadb7 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -12,9 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - target_arch: - - "mipsle-softfloat" - - "mipsle-hardfloat" + target_arch: ${{ fromJson(env.TARGET_ARCH) }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -34,17 +32,15 @@ jobs: needs: setup strategy: matrix: - target_arch: - - "mipsle-softfloat" - - "mipsle-hardfloat" + target_arch: ${{ fromJson(env.TARGET_ARCH) }} steps: - name: Checkout Code uses: actions/checkout@v4 - name: Build env: - GOARCH: ${{ contains(matrix.target_arch, 'mipsle') && 'mipsle' || '' }} - GOMIPS: ${{ contains(matrix.target_arch, 'softfloat') && 'softfloat' || 'hardfloat' }} + GOARCH: ${{ contains(fromJson(env.TARGET_ARCH), 'mipsle') && 'mipsle' || '' }} + GOMIPS: ${{ contains(fromJson(env.TARGET_ARCH), 'softfloat') && 'softfloat' || 'hardfloat' }} CGO_ENABLED: 0 run: | echo "Building for GOARCH=${GOARCH} GOMIPS=${GOMIPS}" @@ -53,17 +49,12 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: cloudflared-${{ matrix.target_arch }} - path: cloudflared-${{ matrix.target_arch }} + name: cloudflared-${{ fromJson(env.TARGET_ARCH) }} + path: cloudflared-${{ fromJson(env.TARGET_ARCH) }} release: runs-on: ubuntu-latest needs: build - strategy: - matrix: - target_arch: - - "mipsle-softfloat" - - "mipsle-hardfloat" steps: - name: Checkout Code uses: actions/checkout@v4 @@ -71,13 +62,13 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 with: - name: cloudflared-${{ matrix.target_arch }} + name: cloudflared-${{ fromJson(env.TARGET_ARCH) }} path: . - name: Generate SHA Sums run: | echo "Generating SHA sums for release assets..." - sha256sum cloudflared-${{ matrix.target_arch }} > SHA256_SUMS + sha256sum cloudflared-${{ fromJson(env.TARGET_ARCH) }} > SHA256_SUMS cat SHA256_SUMS - name: Release