build: 使用环境变量替代矩阵策略中的目标架构
- 将 matrix.target_arch 替换为 fromJson(env.TARGET_ARCH) - 更新构建和上传/下载工件的步骤以使用新的环境变量 - 删除冗余的矩阵配置,简化工作流结构
This commit is contained in:
parent
b94ac63708
commit
787cf4b8ee
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue