mirror of https://github.com/Xhofe/alist
feat: add `windows/arm64` target (close #3308)
parent
dca115506d
commit
ab7dee49b0
|
@ -25,6 +25,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
sudo snap install zig --classic --beta
|
||||||
docker pull crazymax/xgo:latest
|
docker pull crazymax/xgo:latest
|
||||||
go install github.com/crazy-max/xgo@latest
|
go install github.com/crazy-max/xgo@latest
|
||||||
sudo apt install upx
|
sudo apt install upx
|
||||||
|
|
|
@ -38,6 +38,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
sudo snap install zig --classic --beta
|
||||||
docker pull crazymax/xgo:latest
|
docker pull crazymax/xgo:latest
|
||||||
go install github.com/crazy-max/xgo@latest
|
go install github.com/crazy-max/xgo@latest
|
||||||
sudo apt install upx
|
sudo apt install upx
|
||||||
|
|
13
build.sh
13
build.sh
|
@ -41,14 +41,24 @@ FetchWebRelease() {
|
||||||
rm -rf dist.tar.gz
|
rm -rf dist.tar.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuildWinArm64() {
|
||||||
|
echo building for windows-arm64
|
||||||
|
export GOOS=windows
|
||||||
|
export GOARCH=arm64
|
||||||
|
export CC=$(pwd)/wrapper/zcc-arm64
|
||||||
|
export CXX=$(pwd)/wrapper/zcxx-arm64
|
||||||
|
go build -o "$1" -ldflags="$ldflags" -tags=jsoniter .
|
||||||
|
}
|
||||||
|
|
||||||
BuildDev() {
|
BuildDev() {
|
||||||
rm -rf .git/
|
rm -rf .git/
|
||||||
|
BuildWinArm64 ./alist-windows-arm64.exe
|
||||||
xgo -targets=linux/amd64,windows/amd64,darwin/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
xgo -targets=linux/amd64,windows/amd64,darwin/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
||||||
mkdir -p "dist"
|
mkdir -p "dist"
|
||||||
mv alist-* dist
|
mv alist-* dist
|
||||||
cd dist
|
cd dist
|
||||||
upx -9 ./alist-linux*
|
upx -9 ./alist-linux*
|
||||||
upx -9 ./alist-windows*
|
upx -9 ./alist-windows-amd64.exe
|
||||||
find . -type f -print0 | xargs -0 md5sum >md5.txt
|
find . -type f -print0 | xargs -0 md5sum >md5.txt
|
||||||
cat md5.txt
|
cat md5.txt
|
||||||
}
|
}
|
||||||
|
@ -80,6 +90,7 @@ BuildRelease() {
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
go build -o ./build/$appName-$os_arch -ldflags="$muslflags" -tags=jsoniter .
|
go build -o ./build/$appName-$os_arch -ldflags="$muslflags" -tags=jsoniter .
|
||||||
done
|
done
|
||||||
|
BuildWinArm64 ./build/alist-windows-arm64.exe
|
||||||
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
||||||
# why? Because some target platforms seem to have issues with upx compression
|
# why? Because some target platforms seem to have issues with upx compression
|
||||||
upx -9 ./alist-linux-amd64
|
upx -9 ./alist-linux-amd64
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
zig cc -target aarch64-windows-gnu $@
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
zig c++ -target aarch64-windows-gnu $@
|
Loading…
Reference in New Issue