Files
OpenList/build.sh

377 lines
14 KiB
Bash
Raw Normal View History

set -e
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
appName="openlist"
2022-08-29 22:44:55 +08:00
builtAt="$(date +'%F %T %z')"
gitAuthor="The OpenList Projects Contributors <noreply@openlist.team>"
2022-08-29 22:44:55 +08:00
gitCommit=$(git log --pretty=format:"%h" -1)
githubAuthHeader=""
githubAuthValue=""
if [ -n "$GITHUB_TOKEN" ]; then
githubAuthHeader="--header"
githubAuthValue="Authorization: Bearer $GITHUB_TOKEN"
fi
2022-09-08 20:18:45 +08:00
if [ "$1" = "dev" ]; then
2022-08-29 22:44:55 +08:00
version="dev"
webVersion="dev"
elif [ "$1" = "beta" ]; then
version="beta"
webVersion="dev"
2022-09-08 20:18:45 +08:00
else
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
git tag -d beta || true
# Always true if there's no tag
version=$(git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0")
webVersion=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
2022-08-29 22:44:55 +08:00
fi
echo "backend version: $version"
echo "frontend version: $webVersion"
2022-08-29 22:44:55 +08:00
ldflags="\
-w -s \
-X 'github.com/OpenListTeam/OpenList/internal/conf.BuiltAt=$builtAt' \
-X 'github.com/OpenListTeam/OpenList/internal/conf.GitAuthor=$gitAuthor' \
-X 'github.com/OpenListTeam/OpenList/internal/conf.GitCommit=$gitCommit' \
-X 'github.com/OpenListTeam/OpenList/internal/conf.Version=$version' \
-X 'github.com/OpenListTeam/OpenList/internal/conf.WebVersion=$webVersion' \
2022-08-29 22:44:55 +08:00
"
2022-09-08 20:18:45 +08:00
FetchWebDev() {
pre_release_tag=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases | jq -r 'map(select(.prerelease)) | first | .tag_name')
if [ -z "$pre_release_tag" ] || [ "$pre_release_tag" == "null" ]; then
# fall back to latest release
pre_release_json=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest")
else
pre_release_json=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/tags/$pre_release_tag")
fi
pre_release_assets=$(echo "$pre_release_json" | jq -r '.assets[].browser_download_url')
pre_release_tar_url=$(echo "$pre_release_assets" | grep "openlist-frontend-dist" | grep "\.tar\.gz$")
curl -fsSL "$pre_release_tar_url" -o web-dist-dev.tar.gz
rm -rf public/dist && mkdir -p public/dist
tar -zxvf web-dist-dev.tar.gz -C public/dist
rm -rf web-dist-dev.tar.gz
2022-08-29 22:44:55 +08:00
}
2022-09-08 21:22:21 +08:00
FetchWebRelease() {
release_json=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest")
release_assets=$(echo "$release_json" | jq -r '.assets[].browser_download_url')
release_tar_url=$(echo "$release_assets" | grep "openlist-frontend-dist" | grep "\.tar\.gz$")
curl -fsSL "$release_tar_url" -o dist.tar.gz
rm -rf public/dist && mkdir -p public/dist
tar -zxvf dist.tar.gz -C public/dist
2022-09-08 21:22:21 +08:00
rm -rf dist.tar.gz
}
BuildWinArm64() {
echo building for windows-arm64
2023-02-14 20:28:05 +08:00
chmod +x ./wrapper/zcc-arm64
chmod +x ./wrapper/zcxx-arm64
export GOOS=windows
export GOARCH=arm64
export CC=$(pwd)/wrapper/zcc-arm64
export CXX=$(pwd)/wrapper/zcxx-arm64
export CGO_ENABLED=1
go build -o "$1" -ldflags="$ldflags" -tags=jsoniter .
}
2022-08-29 22:44:55 +08:00
BuildDev() {
rm -rf .git/
mkdir -p "dist"
muslflags="--extldflags '-static -fpic' $ldflags"
BASE="https://github.com/OpenListTeam/musl-compilers/releases/latest/download/"
FILES=(x86_64-linux-musl-cross aarch64-linux-musl-cross)
for i in "${FILES[@]}"; do
url="${BASE}${i}.tgz"
curl -fsSL -o "${i}.tgz" "${url}"
sudo tar xf "${i}.tgz" --strip-components 1 -C /usr/local
done
OS_ARCHES=(linux-musl-amd64 linux-musl-arm64)
CGO_ARGS=(x86_64-linux-musl-gcc aarch64-linux-musl-gcc)
for i in "${!OS_ARCHES[@]}"; do
os_arch=${OS_ARCHES[$i]}
cgo_cc=${CGO_ARGS[$i]}
echo building for ${os_arch}
export GOOS=${os_arch%%-*}
export GOARCH=${os_arch##*-}
export CC=${cgo_cc}
export CGO_ENABLED=1
go build -o ./dist/$appName-$os_arch -ldflags="$muslflags" -tags=jsoniter .
done
xgo -targets=windows/amd64,darwin/amd64,darwin/arm64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
mv "$appName"-* dist
2022-08-29 22:44:55 +08:00
cd dist
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
cp ./"$appName"-windows-amd64.exe ./"$appName"-windows-amd64-upx.exe
upx -9 ./"$appName"-windows-amd64-upx.exe
2022-08-29 22:44:55 +08:00
find . -type f -print0 | xargs -0 md5sum >md5.txt
cat md5.txt
}
BuildDocker() {
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
go build -o ./bin/"$appName" -ldflags="$ldflags" -tags=jsoniter .
2022-09-08 20:18:45 +08:00
}
PrepareBuildDockerMusl() {
mkdir -p build/musl-libs
BASE="https://github.com/OpenListTeam/musl-compilers/releases/latest/download/"
FILES=(x86_64-linux-musl-cross aarch64-linux-musl-cross i486-linux-musl-cross s390x-linux-musl-cross armv6-linux-musleabihf-cross armv7l-linux-musleabihf-cross riscv64-linux-musl-cross powerpc64le-linux-musl-cross)
for i in "${FILES[@]}"; do
url="${BASE}${i}.tgz"
lib_tgz="build/${i}.tgz"
curl -fsSL -o "${lib_tgz}" "${url}"
tar xf "${lib_tgz}" --strip-components 1 -C build/musl-libs
rm -f "${lib_tgz}"
done
}
BuildDockerMultiplatform() {
go mod download
# run PrepareBuildDockerMusl before build
export PATH=$PATH:$PWD/build/musl-libs/bin
docker_lflags="--extldflags '-static -fpic' $ldflags"
export CGO_ENABLED=1
OS_ARCHES=(linux-amd64 linux-arm64 linux-386 linux-s390x linux-riscv64 linux-ppc64le)
CGO_ARGS=(x86_64-linux-musl-gcc aarch64-linux-musl-gcc i486-linux-musl-gcc s390x-linux-musl-gcc riscv64-linux-musl-gcc powerpc64le-linux-musl-gcc)
for i in "${!OS_ARCHES[@]}"; do
os_arch=${OS_ARCHES[$i]}
cgo_cc=${CGO_ARGS[$i]}
os=${os_arch%%-*}
arch=${os_arch##*-}
export GOOS=$os
export GOARCH=$arch
export CC=${cgo_cc}
echo "building for $os_arch"
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
go build -o build/$os/$arch/"$appName" -ldflags="$docker_lflags" -tags=jsoniter .
done
DOCKER_ARM_ARCHES=(linux-arm/v6 linux-arm/v7)
CGO_ARGS=(armv6-linux-musleabihf-gcc armv7l-linux-musleabihf-gcc)
GO_ARM=(6 7)
export GOOS=linux
export GOARCH=arm
for i in "${!DOCKER_ARM_ARCHES[@]}"; do
docker_arch=${DOCKER_ARM_ARCHES[$i]}
cgo_cc=${CGO_ARGS[$i]}
export GOARM=${GO_ARM[$i]}
export CC=${cgo_cc}
echo "building for $docker_arch"
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
go build -o build/${docker_arch%%-*}/${docker_arch##*-}/"$appName" -ldflags="$docker_lflags" -tags=jsoniter .
done
}
2022-09-08 21:22:21 +08:00
BuildRelease() {
2023-09-03 22:53:58 +08:00
rm -rf .git/
mkdir -p "build"
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
BuildWinArm64 ./build/"$appName"-windows-arm64.exe
2023-09-03 22:53:58 +08:00
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
# why? Because some target platforms seem to have issues with upx compression
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
upx -9 ./"$appName"-linux-amd64
cp ./"$appName"-windows-amd64.exe ./"$appName"-windows-amd64-upx.exe
upx -9 ./"$appName"-windows-amd64-upx.exe
mv "$appName"-* build
2023-09-03 22:53:58 +08:00
}
BuildReleaseLinuxMusl() {
2022-09-08 21:22:21 +08:00
rm -rf .git/
mkdir -p "build"
2022-09-09 15:51:20 +08:00
muslflags="--extldflags '-static -fpic' $ldflags"
BASE="https://github.com/OpenListTeam/musl-compilers/releases/latest/download/"
FILES=(x86_64-linux-musl-cross aarch64-linux-musl-cross mips-linux-musl-cross mips64-linux-musl-cross mips64el-linux-musl-cross mipsel-linux-musl-cross powerpc64le-linux-musl-cross s390x-linux-musl-cross loongarch64-linux-musl-cross)
2022-09-08 21:22:21 +08:00
for i in "${FILES[@]}"; do
url="${BASE}${i}.tgz"
curl -fsSL -o "${i}.tgz" "${url}"
2022-09-08 21:22:21 +08:00
sudo tar xf "${i}.tgz" --strip-components 1 -C /usr/local
rm -f "${i}.tgz"
2022-09-08 21:22:21 +08:00
done
OS_ARCHES=(linux-musl-amd64 linux-musl-arm64 linux-musl-mips linux-musl-mips64 linux-musl-mips64le linux-musl-mipsle linux-musl-ppc64le linux-musl-s390x linux-musl-loong64)
CGO_ARGS=(x86_64-linux-musl-gcc aarch64-linux-musl-gcc mips-linux-musl-gcc mips64-linux-musl-gcc mips64el-linux-musl-gcc mipsel-linux-musl-gcc powerpc64le-linux-musl-gcc s390x-linux-musl-gcc loongarch64-linux-musl-gcc)
2022-09-08 21:22:21 +08:00
for i in "${!OS_ARCHES[@]}"; do
os_arch=${OS_ARCHES[$i]}
cgo_cc=${CGO_ARGS[$i]}
echo building for ${os_arch}
export GOOS=${os_arch%%-*}
export GOARCH=${os_arch##*-}
export CC=${cgo_cc}
export CGO_ENABLED=1
2022-09-09 15:51:20 +08:00
go build -o ./build/$appName-$os_arch -ldflags="$muslflags" -tags=jsoniter .
2022-09-08 21:22:21 +08:00
done
}
BuildReleaseLinuxMuslArm() {
rm -rf .git/
mkdir -p "build"
muslflags="--extldflags '-static -fpic' $ldflags"
BASE="https://github.com/OpenListTeam/musl-compilers/releases/latest/download/"
FILES=(arm-linux-musleabi-cross arm-linux-musleabihf-cross armel-linux-musleabi-cross armel-linux-musleabihf-cross armv5l-linux-musleabi-cross armv5l-linux-musleabihf-cross armv6-linux-musleabi-cross armv6-linux-musleabihf-cross armv7l-linux-musleabihf-cross armv7m-linux-musleabi-cross armv7r-linux-musleabihf-cross)
for i in "${FILES[@]}"; do
url="${BASE}${i}.tgz"
curl -fsSL -o "${i}.tgz" "${url}"
sudo tar xf "${i}.tgz" --strip-components 1 -C /usr/local
rm -f "${i}.tgz"
done
OS_ARCHES=(linux-musleabi-arm linux-musleabihf-arm linux-musleabi-armel linux-musleabihf-armel linux-musleabi-armv5l linux-musleabihf-armv5l linux-musleabi-armv6 linux-musleabihf-armv6 linux-musleabihf-armv7l linux-musleabi-armv7m linux-musleabihf-armv7r)
CGO_ARGS=(arm-linux-musleabi-gcc arm-linux-musleabihf-gcc armel-linux-musleabi-gcc armel-linux-musleabihf-gcc armv5l-linux-musleabi-gcc armv5l-linux-musleabihf-gcc armv6-linux-musleabi-gcc armv6-linux-musleabihf-gcc armv7l-linux-musleabihf-gcc armv7m-linux-musleabi-gcc armv7r-linux-musleabihf-gcc)
GOARMS=('' '' '' '' '5' '5' '6' '6' '7' '7' '7')
for i in "${!OS_ARCHES[@]}"; do
os_arch=${OS_ARCHES[$i]}
cgo_cc=${CGO_ARGS[$i]}
arm=${GOARMS[$i]}
echo building for ${os_arch}
export GOOS=linux
export GOARCH=arm
export CC=${cgo_cc}
export CGO_ENABLED=1
export GOARM=${arm}
go build -o ./build/$appName-$os_arch -ldflags="$muslflags" -tags=jsoniter .
done
}
BuildReleaseAndroid() {
rm -rf .git/
mkdir -p "build"
wget https://dl.google.com/android/repository/android-ndk-r26b-linux.zip
unzip android-ndk-r26b-linux.zip
rm android-ndk-r26b-linux.zip
OS_ARCHES=(amd64 arm64 386 arm)
CGO_ARGS=(x86_64-linux-android24-clang aarch64-linux-android24-clang i686-linux-android24-clang armv7a-linux-androideabi24-clang)
for i in "${!OS_ARCHES[@]}"; do
os_arch=${OS_ARCHES[$i]}
cgo_cc=$(realpath android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/${CGO_ARGS[$i]})
echo building for android-${os_arch}
export GOOS=android
export GOARCH=${os_arch##*-}
export CC=${cgo_cc}
export CGO_ENABLED=1
go build -o ./build/$appName-android-$os_arch -ldflags="$ldflags" -tags=jsoniter .
android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip ./build/$appName-android-$os_arch
done
}
2024-11-01 21:37:53 +08:00
BuildReleaseFreeBSD() {
rm -rf .git/
mkdir -p "build/freebsd"
# Get latest FreeBSD 14.x release version from GitHub
freebsd_version=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue "https://api.github.com/repos/freebsd/freebsd-src/tags" | \
jq -r '.[].name' | \
grep '^release/14\.' | \
sort -V | \
tail -1 | \
sed 's/release\///' | \
sed 's/\.0$//')
if [ -z "$freebsd_version" ]; then
echo "Failed to get FreeBSD version, falling back to 14.3"
freebsd_version="14.3"
fi
echo "Using FreeBSD version: $freebsd_version"
2024-11-01 21:37:53 +08:00
OS_ARCHES=(amd64 arm64 i386)
GO_ARCHES=(amd64 arm64 386)
CGO_ARGS=(x86_64-unknown-freebsd${freebsd_version} aarch64-unknown-freebsd${freebsd_version} i386-unknown-freebsd${freebsd_version})
2024-11-01 21:37:53 +08:00
for i in "${!OS_ARCHES[@]}"; do
os_arch=${OS_ARCHES[$i]}
cgo_cc="clang --target=${CGO_ARGS[$i]} --sysroot=/opt/freebsd/${os_arch}"
echo building for freebsd-${os_arch}
sudo mkdir -p "/opt/freebsd/${os_arch}"
wget -q https://download.freebsd.org/releases/${os_arch}/${freebsd_version}-RELEASE/base.txz
2024-11-01 21:37:53 +08:00
sudo tar -xf ./base.txz -C /opt/freebsd/${os_arch}
rm base.txz
export GOOS=freebsd
export GOARCH=${GO_ARCHES[$i]}
export CC=${cgo_cc}
export CGO_ENABLED=1
export CGO_LDFLAGS="-fuse-ld=lld"
go build -o ./build/$appName-freebsd-$os_arch -ldflags="$ldflags" -tags=jsoniter .
done
}
2022-09-08 21:22:21 +08:00
MakeRelease() {
cd build
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
if [ -d compress ]; then
rm -rv compress
fi
2022-09-08 21:22:21 +08:00
mkdir compress
for i in $(find . -type f -name "$appName-linux-*"); do
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
cp "$i" "$appName"
tar -czvf compress/"$i".tar.gz "$appName"
rm -f "$appName"
done
for i in $(find . -type f -name "$appName-android-*"); do
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
cp "$i" "$appName"
tar -czvf compress/"$i".tar.gz "$appName"
rm -f "$appName"
2022-09-08 21:22:21 +08:00
done
for i in $(find . -type f -name "$appName-darwin-*"); do
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
cp "$i" "$appName"
tar -czvf compress/"$i".tar.gz "$appName"
rm -f "$appName"
2022-09-08 21:22:21 +08:00
done
2024-11-01 21:37:53 +08:00
for i in $(find . -type f -name "$appName-freebsd-*"); do
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
cp "$i" "$appName"
tar -czvf compress/"$i".tar.gz "$appName"
rm -f "$appName"
2024-11-01 21:37:53 +08:00
done
2022-09-08 21:22:21 +08:00
for i in $(find . -type f -name "$appName-windows-*"); do
chore(docs&ci): change links in files & fix github ci and docker ci (#3) * Enable blank issue * chore(README.md): update docs (temporally) * Update FUNDING.yml * chore: purge README.md * Update README.md Alist改为OpenList * Update README_cn.md Alist改为OpenList * Update README.md 漏了一处 * Update README_ja.md Alist改为OpenList * Update README_cn.md 漏了一处 * Update CODE_OF_CONDUCT.md 更改链接 * Update README.md 更新tg链接 * Update README_cn.md 更新tg链接 * Update README_ja.md 更新tg链接 * chore(build&docs): use new links in build and github templates * Update README.md 更新团队名 * chore: disable translation update, change beta release into artifacts * fix: disable docker build and name the uploaded artifacts * fix typo * Update README_cn.md 更新团队名称 * Update README_ja.md 更新 * Update project name in CONTRIBUTING.md * Update README_cn.md 更新 * Update README.md 更新 * Update README_ja.md * fix: fix artifact name * chore(build.sh): use original musl.cc * fix(ci): fix action artifacts upload * Update CODE_OF_CONDUCT.md TG更改为Telegram * Update README_cn.md 更新论坛链接 * Update README.md 更新论坛链接 * Update README_ja.md 更新论坛链接 * feat: update community based call back for onedrive * chore(ci): update musl.cc link * chore: use openlist as name instead of default OpenList * Update user.go * chore: fix artifact name * feat(ci): add docker build test * fix: add more platforms * fix: explicitly use docker.io * fix: fix typo * fix(docker): fix test build push platform * chore: change to OpenListTeam * Update CODE_OF_CONDUCT.md * doc: update org name * docs: change repo urls * feat: release docker image to ghcr.io on tagging * fix: fix the name of test_docker * build: update the names in docker-compose and docker file * chore: rename --------- Co-authored-by: ShenLin <773933146@qq.com> Co-authored-by: Hantong Chen <cxwdyx620@gmail.com> Co-authored-by: joshua <i@joshua.su> Co-authored-by: 绎泽 <yize@tencent.to> Co-authored-by: zyk2507 <93830642+zyk2507@users.noreply.github.com>
2025-06-12 21:29:43 +08:00
cp "$i" "$appName".exe
zip compress/$(echo $i | sed 's/\.[^.]*$//').zip "$appName".exe
rm -f "$appName".exe
2022-09-08 21:22:21 +08:00
done
cd compress
find . -type f -print0 | xargs -0 md5sum >"$1"
cat "$1"
2022-09-08 21:22:21 +08:00
cd ../..
}
2022-08-29 22:44:55 +08:00
if [ "$1" = "dev" ]; then
2022-09-08 20:18:45 +08:00
FetchWebDev
if [ "$2" = "docker" ]; then
BuildDocker
elif [ "$2" = "docker-multiplatform" ]; then
BuildDockerMultiplatform
2024-08-18 00:21:48 +08:00
elif [ "$2" = "web" ]; then
echo "web only"
2022-09-08 20:18:45 +08:00
else
BuildDev
fi
elif [ "$1" = "release" -o "$1" = "beta" ]; then
if [ "$1" = "beta" ]; then
FetchWebDev
else
FetchWebRelease
fi
2022-09-08 21:22:21 +08:00
if [ "$2" = "docker" ]; then
BuildDocker
elif [ "$2" = "docker-multiplatform" ]; then
BuildDockerMultiplatform
elif [ "$2" = "linux_musl_arm" ]; then
BuildReleaseLinuxMuslArm
MakeRelease "md5-linux-musl-arm.txt"
2023-09-03 22:53:58 +08:00
elif [ "$2" = "linux_musl" ]; then
BuildReleaseLinuxMusl
MakeRelease "md5-linux-musl.txt"
elif [ "$2" = "android" ]; then
BuildReleaseAndroid
MakeRelease "md5-android.txt"
2024-11-01 21:37:53 +08:00
elif [ "$2" = "freebsd" ]; then
BuildReleaseFreeBSD
MakeRelease "md5-freebsd.txt"
2024-08-18 00:21:48 +08:00
elif [ "$2" = "web" ]; then
echo "web only"
2022-09-08 21:22:21 +08:00
else
BuildRelease
MakeRelease "md5.txt"
2022-09-08 21:22:21 +08:00
fi
elif [ "$1" = "prepare" ]; then
if [ "$2" = "docker-multiplatform" ]; then
PrepareBuildDockerMusl
fi
2024-08-18 00:21:48 +08:00
elif [ "$1" = "zip" ]; then
MakeRelease "$2".txt
2022-08-29 22:44:55 +08:00
else
echo -e "Parameter error"
2022-09-08 21:22:21 +08:00
fi