-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): use
go-cross/cgo-actions
for dev build
- Loading branch information
Showing
1 changed file
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,34 +15,48 @@ jobs: | |
strategy: | ||
matrix: | ||
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 | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo snap install zig --classic --beta | ||
docker pull crazymax/xgo:latest | ||
go install github.com/crazy-max/xgo@latest | ||
sudo apt install upx | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Setup web | ||
run: bash build.sh dev web | ||
|
||
- name: Build | ||
run: | | ||
bash build.sh dev | ||
uses: go-cross/cgo-actions@v1 | ||
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 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: alist_${{ env.SHA }} | ||
path: dist | ||
name: alist_${{ env.SHA }}_${{ matrix.target }} | ||
path: build/* |