fix: improve Windows build support and CI/CD workflow (#283)

- Fix Windows zip command issue by using PowerShell Compress-Archive
- Add Windows support for OSS upload with ossutil
- Replace Chinese comments with English in build.yml
- Fix bash syntax error in package_zip function
- Improve code formatting and consistency
- Update various configuration files for better cross-platform support

Resolves Windows build failures in GitHub Actions.
This commit is contained in:
安正超
2025-07-22 23:55:57 +08:00
committed by GitHub
parent 629db6218e
commit affe27298c
7 changed files with 139 additions and 62 deletions

View File

@@ -16,12 +16,12 @@
# 脚本名称scp_to_servers.sh
rm ./target/x86_64-unknown-linux-musl/release/rustfs.zip
# 压缩./target/x86_64-unknown-linux-musl/release/rustfs
zip -j ./target/x86_64-unknown-linux-musl/release/rustfs.zip ./target/x86_64-unknown-linux-musl/release/rustfs
rm ./target/x86_64-unknown-linux-gnu/release/rustfs.zip
# 压缩./target/x86_64-unknown-linux-gnu/release/rustfs
zip -j ./target/x86_64-unknown-linux-gnu/release/rustfs.zip ./target/x86_64-unknown-linux-gnu/release/rustfs
# 本地文件路径
LOCAL_FILE="./target/x86_64-unknown-linux-musl/release/rustfs.zip"
# 上传到服务器
LOCAL_FILE="./target/x86_64-unknown-linux-gnu/release/rustfs.zip"
REMOTE_PATH="~"
# 必须传入IP参数否则报错退出

View File

@@ -8,7 +8,7 @@ set -e
echo "Setting up test binaries for Docker build..."
# Create temporary rustfs binary
./build-rustfs.sh -p x86_64-unknown-linux-musl
./build-rustfs.sh -p x86_64-unknown-linux-gnu
# Create test directory structure
mkdir -p test-releases/server/rustfs/release/linux-amd64/archive
@@ -18,16 +18,16 @@ mkdir -p test-releases/server/rustfs/release/linux-arm64/archive
VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || git rev-parse --short HEAD)
# Copy binaries
cp target/release/x86_64-unknown-linux-musl/rustfs test-releases/server/rustfs/release/linux-amd64/archive/rustfs.${VERSION}
cp target/release/x86_64-unknown-linux-musl/rustfs.sha256sum test-releases/server/rustfs/release/linux-amd64/archive/rustfs.${VERSION}.sha256sum
cp target/x86_64-unknown-linux-gnu/release/rustfs test-releases/server/rustfs/release/linux-amd64/archive/rustfs.${VERSION}
cp target/x86_64-unknown-linux-gnu/release/rustfs.sha256sum test-releases/server/rustfs/release/linux-amd64/archive/rustfs.${VERSION}.sha256sum
# Create dummy signatures
echo "dummy signature" > test-releases/server/rustfs/release/linux-amd64/archive/rustfs.${VERSION}.minisig
echo "dummy signature" > test-releases/server/rustfs/release/linux-arm64/archive/rustfs.${VERSION}.minisig
# Also copy for arm64 (using same binary for testing)
cp target/release/x86_64-unknown-linux-musl/rustfs test-releases/server/rustfs/release/linux-arm64/archive/rustfs.${VERSION}
cp target/release/x86_64-unknown-linux-musl/rustfs.sha256sum test-releases/server/rustfs/release/linux-arm64/archive/rustfs.${VERSION}.sha256sum
cp target/aarch64-unknown-linux-gnu/release/rustfs test-releases/server/rustfs/release/linux-arm64/archive/rustfs.${VERSION}
cp target/aarch64-unknown-linux-gnu/release/rustfs.sha256sum test-releases/server/rustfs/release/linux-arm64/archive/rustfs.${VERSION}.sha256sum
echo "Test binaries created for version: ${VERSION}"
echo "You can now test Docker builds with these local binaries"