mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
ci: better build.yml
This commit is contained in:
parent
41e3571e1d
commit
092e53586e
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
|
@ -31,7 +31,7 @@ jobs:
|
|||
- { goos: darwin, goarch: amd64, goamd64: v3, output: amd64 }
|
||||
|
||||
- { goos: linux, goarch: '386', output: '386' }
|
||||
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible }
|
||||
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible, test: test }
|
||||
- { goos: linux, goarch: amd64, goamd64: v3, output: amd64 }
|
||||
- { goos: linux, goarch: arm64, output: arm64 }
|
||||
- { goos: linux, goarch: arm, goarm: '7', output: armv7 }
|
||||
|
@ -62,32 +62,35 @@ jobs:
|
|||
- { goos: android, goarch: arm, ndk: armv7a-linux-androideabi34, output: armv7 }
|
||||
- { goos: android, goarch: arm64, ndk: aarch64-linux-android34, output: arm64-v8 }
|
||||
|
||||
- { goos: windows, goarch: '386', output: '386-go120', version: 20 }
|
||||
- { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, version: 20 }
|
||||
- { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go120, version: 20 }
|
||||
# Go 1.20 is the last release that will run on any release of Windows 7, 8, Server 2008 and Server 2012. Go 1.21 will require at least Windows 10 or Server 2016.
|
||||
- { goos: windows, goarch: '386', output: '386-go120', goversion: '1.20' }
|
||||
- { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' }
|
||||
- { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
|
||||
|
||||
- { goos: darwin, goarch: arm64, output: arm64-go120, version: 20 }
|
||||
- { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, version: 20 }
|
||||
- { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, version: 20 }
|
||||
# Go 1.20 is the last release that will run on macOS 10.13 High Sierra or 10.14 Mojave. Go 1.21 will require macOS 10.15 Catalina or later.
|
||||
- { goos: darwin, goarch: arm64, output: arm64-go120, goversion: '1.20' }
|
||||
- { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' }
|
||||
- { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
|
||||
|
||||
- { goos: linux, goarch: '386', output: '386-go120', version: 20 }
|
||||
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, version: 20 }
|
||||
- { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go120, version: 20 }
|
||||
# only for test
|
||||
- { goos: linux, goarch: '386', output: '386-go120', goversion: '1.20' }
|
||||
- { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20', test: test }
|
||||
- { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go1.22
|
||||
if: ${{ matrix.jobs.version != '20' && matrix.jobs.goarch != 'loong64' }}
|
||||
- name: Set up Go
|
||||
if: ${{ matrix.jobs.goversion == '' && matrix.jobs.goarch != 'loong64' }}
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
- name: Set up Go1.20
|
||||
if: ${{ matrix.jobs.version == '20' && matrix.jobs.goarch != 'loong64' }}
|
||||
- name: Set up Go
|
||||
if: ${{ matrix.jobs.goversion != '' && matrix.jobs.goarch != 'loong64' }}
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.20'
|
||||
go-version: ${{ matrix.jobs.goversion }}
|
||||
|
||||
- name: Set up Go1.21 loongarch abi1
|
||||
if: ${{ matrix.jobs.goarch == 'loong64' && matrix.jobs.abi == '1' }}
|
||||
|
@ -135,7 +138,12 @@ jobs:
|
|||
echo "CGO_ENABLED=1" >> $GITHUB_ENV
|
||||
echo "BUILDTAG=" >> $GITHUB_ENV
|
||||
|
||||
- name: build core
|
||||
- name: Test
|
||||
if: ${{ matrix.jobs.test == 'test' }}
|
||||
run: |
|
||||
go test ./...
|
||||
|
||||
- name: Build core
|
||||
env:
|
||||
GOOS: ${{matrix.jobs.goos}}
|
||||
GOARCH: ${{matrix.jobs.goarch}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user