8000 feat(ci): use `go-cross/cgo-actions` for dev build · AlistGo/alist@f88fd83 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit f88fd83

Browse files
committed
feat(ci): use go-cross/cgo-actions for dev build
1 parent 226c349 commit f88fd83

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

.github/workflows/build.yml

+29-15
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,48 @@ jobs:
1515
strategy:
1616
matrix:
1717
platform: [ubuntu-latest]
18-
go-version: [ '1.21' ]
18+
target:
19+
- darwin-amd64
20+
- darwin-arm64
21+
- windows-amd64
22+
- linux-arm64-musl
23+
- linux-amd64-musl
24+
- windows-arm64
25+
- android-arm64
1926
name: Build
2027
runs-on: ${{ matrix.platform }}
2128
steps:
22-
- name: Setup Go
23-
uses: actions/setup-go@v5
24-
with:
25-
go-version: ${{ matrix.go-version }}
2629

2730
- name: Checkout
2831
uses: actions/checkout@v4
2932

3033
- uses: benjlevesque/short-sha@v3.0
3134
id: short-sha
3235

33-
- name: Install dependencies
34-
run: |
35-
sudo snap install zig --classic --beta
36-
docker pull crazymax/xgo:latest
37-
go install github.com/crazy-max/xgo@latest
38-
sudo apt install upx
36+
- name: Setup Go
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version: '1.22'
40+
41+
- name: Setup web
42+
run: bash build.sh dev web
3943

4044
- name: Build
41-
run: |
42-
bash build.sh dev
45+
uses: go-cross/cgo-actions@v1
46+
with:
47+
targets: ${{ matrix.target }}
48+
musl-target-format: $os-$musl-$arch
49+
out-dir: build
50+
x-flags: |
51+
github.com/alist-org/alist/v3/internal/conf.BuiltAt=$built_at
52+
github.com/alist-org/alist/v3/internal/conf.GoVersion=$go_version
53+
github.com/alist-org/alist/v3/internal/conf.GitAuthor=Xhofe
54+
github.com/alist-org/alist/v3/internal/conf.GitCommit=$git_commit
55+
github.com/alist-org/alist/v3/internal/conf.Version=$tag
56+
6B0D github.com/alist-org/alist/v3/internal/conf.WebVersion=dev
4357
4458
- name: Upload artifact
4559
uses: actions/upload-artifact@v4
4660
with:
47-
name: alist_${{ env.SHA }}
48-
path: dist
61+
name: alist_${{ env.SHA }}_${{ matrix.target }}
62+
path: build/*

0 commit comments

Comments
 (0)
0