feat(ci): use go-cross/cgo-actions
for dev build
This commit is contained in:
parent
226c34929a
commit
f88fd83d4a
44
.github/workflows/build.yml
vendored
44
.github/workflows/build.yml
vendored
@ -15,14 +15,17 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest]
|
platform: [ubuntu-latest]
|
||||||
go-version: [ '1.21' ]
|
target:
|
||||||
|
- darwin-amd64
|
||||||
|
- darwin-arm64
|
||||||
|
- windows-amd64
|
||||||
|
- linux-arm64-musl
|
||||||
|
- linux-amd64-musl
|
||||||
|
- windows-arm64
|
||||||
|
- android-arm64
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ matrix.go-version }}
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -30,19 +33,30 @@ jobs:
|
|||||||
- uses: benjlevesque/short-sha@v3.0
|
- uses: benjlevesque/short-sha@v3.0
|
||||||
id: short-sha
|
id: short-sha
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Setup Go
|
||||||
run: |
|
uses: actions/setup-go@v5
|
||||||
sudo snap install zig --classic --beta
|
with:
|
||||||
docker pull crazymax/xgo:latest
|
go-version: '1.22'
|
||||||
go install github.com/crazy-max/xgo@latest
|
|
||||||
sudo apt install upx
|
- name: Setup web
|
||||||
|
run: bash build.sh dev web
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
uses: go-cross/cgo-actions@v1
|
||||||
bash build.sh dev
|
with:
|
||||||
|
targets: ${{ matrix.target }}
|
||||||
|
musl-target-format: $os-$musl-$arch
|
||||||
|
out-dir: build
|
||||||
|
x-flags: |
|
||||||
|
github.com/alist-org/alist/v3/internal/conf.BuiltAt=$built_at
|
||||||
|
github.com/alist-org/alist/v3/internal/conf.GoVersion=$go_version
|
||||||
|
github.com/alist-org/alist/v3/internal/conf.GitAuthor=Xhofe
|
||||||
|
github.com/alist-org/alist/v3/internal/conf.GitCommit=$git_commit
|
||||||
|
github.com/alist-org/alist/v3/internal/conf.Version=$tag
|
||||||
|
github.com/alist-org/alist/v3/internal/conf.WebVersion=dev
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: alist_${{ env.SHA }}
|
name: alist_${{ env.SHA }}_${{ matrix.target }}
|
||||||
path: dist
|
path: build/*
|
Loading…
x
Reference in New Issue
Block a user