This commit is contained in:
2026-01-02 17:32:15 +08:00
parent 59ba60567f
commit c397859ae0

View File

@@ -1,27 +1,29 @@
# Woodpecker CI for Fig language # Woodpecker CI for Fig project
# Linux + Windows cross compile # WSL2 Docker Runner, Linux + Windows cross compile
# 国内源 + apt cache,适合 WSL2 Docker Runner # 国内源 + apt cache
volumes: volumes:
- name: apt-cache - name: apt-cache
path: /var/cache/apt path: /var/cache/apt
steps: steps:
- name: build-and-cross - name: build-cross
image: ubuntu:24.04 image: ubuntu:24.04
volumes: volumes:
- type: cache - type: cache
name: apt-cache name: apt-cache
path: /var/cache/apt path: /var/cache/apt
commands: commands:
# 源加速 # 国内源加速
- cp /etc/apt/sources.list /etc/apt/sources.list.bak - cp /etc/apt/sources.list /etc/apt/sources.list.bak
- echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" > /etc/apt/sources.list - |
- echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse" >> /etc/apt/sources.list cat << EOF > /etc/apt/sources.list
- echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse" >> /etc/apt/sources.list deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs) main restricted universe multiverse
- echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse" >> /etc/apt/sources.list deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
EOF
# 安装依赖apt cache 会复用)
- apt-get update -y - apt-get update -y
- apt-get install -y curl git build-essential clang llvm mingw-w64 ninja-build jq - apt-get install -y curl git build-essential clang llvm mingw-w64 ninja-build jq
@@ -35,7 +37,7 @@ steps:
- mkdir -p dist - mkdir -p dist
- cp `xmake u -o`/Fig dist/Fig-linux - cp `xmake u -o`/Fig dist/Fig-linux
# 构建 Windows release (cross compile) # 构建 Windows release
- xmake f -m release --plat=windows --arch=x86_64 --cc=x86_64-w64-mingw32-g++ --cxx=x86_64-w64-mingw32-g++ - xmake f -m release --plat=windows --arch=x86_64 --cc=x86_64-w64-mingw32-g++ --cxx=x86_64-w64-mingw32-g++
- xmake -v - xmake -v
- cp `xmake u -o`/Fig.exe dist/Fig-windows.exe - cp `xmake u -o`/Fig.exe dist/Fig-windows.exe