Update build.yml

This commit is contained in:
tidex 2025-02-15 21:30:39 +08:00 committed by GitHub
parent 07f6f05c87
commit 03cd055e6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 6 deletions

View File

@ -2,18 +2,18 @@ name: Cross Build
on:
push:
branches: [ "main" ] # 触发分支
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch: # 允许手动触发
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target_arch: # 定义目标架构列表
- "mipsle-softfloat" # MIPS 小端序软浮点
target_arch:
- "mipsle-softfloat"
steps:
- name: Checkout Code
uses: actions/checkout@v4
@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21' # 指定 Go 版本
go-version: '1.21'
- name: Install Dependencies
run: |
@ -30,7 +30,8 @@ jobs:
- name: Build
env:
GOARCH: ${{ matrix.target_arch.split('-')[0] }}
# 使用 GitHub Actions 表达式语法分割字符串
GOARCH: ${{ fromJSON('["' + matrix.target_arch.split('-').join('","') + '"]')[0] }}
GOMIPS: ${{ contains(matrix.target_arch, 'mipsle') && 'softfloat' || '' }}
CGO_ENABLED: 0
run: |