This commit is contained in:
@@ -8,6 +8,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
SHELL: "/bin/bash"
|
SHELL: "/bin/bash"
|
||||||
commands:
|
commands:
|
||||||
|
# 使用国内源加速
|
||||||
- cp /etc/apt/sources.list /etc/apt/sources.list.backup
|
- cp /etc/apt/sources.list /etc/apt/sources.list.backup
|
||||||
- |
|
- |
|
||||||
cat <<EOF > /etc/apt/sources.list
|
cat <<EOF > /etc/apt/sources.list
|
||||||
@@ -16,17 +17,23 @@ steps:
|
|||||||
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)-security main restricted universe multiverse
|
||||||
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- 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
|
||||||
|
|
||||||
|
# 安装 xmake
|
||||||
- curl -fsSL https://xmake.io/shget.text | bash
|
- curl -fsSL https://xmake.io/shget.text | bash
|
||||||
- export PATH=$PATH:/root/.xmake/bin
|
|
||||||
- xmake f -m release
|
# 使用 xmake 绝对路径
|
||||||
- xmake -v
|
- /root/.xmake/bin/xmake f -m release
|
||||||
|
- /root/.xmake/bin/xmake -v
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- cp `xmake u -o`/Fig dist/Fig-linux
|
- cp `/root/.xmake/bin/xmake u -o`/Fig dist/Fig-linux
|
||||||
- xmake f -m release --plat=windows --arch=x86_64 --cc=x86_64-w64-mingw32-g++ --cxx=x86_64-w64-mingw32-g++
|
|
||||||
- xmake -v
|
# Windows cross-build
|
||||||
- cp `xmake u -o`/Fig.exe dist/Fig-windows.exe
|
- /root/.xmake/bin/xmake f -m release --plat=windows --arch=x86_64 --cc=x86_64-w64-mingw32-g++ --cxx=x86_64-w64-mingw32-g++
|
||||||
|
- /root/.xmake/bin/xmake -v
|
||||||
|
- cp `/root/.xmake/bin/xmake u -o`/Fig.exe dist/Fig-windows.exe
|
||||||
|
|
||||||
- name: gitea-release
|
- name: gitea-release
|
||||||
image: "ubuntu:24.04"
|
image: "ubuntu:24.04"
|
||||||
@@ -39,10 +46,14 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- TAG=${DRONE_TAG}
|
- TAG=${DRONE_TAG}
|
||||||
- echo "Uploading Fig binaries for tag $TAG to Gitea"
|
- echo "Uploading Fig binaries for tag $TAG to Gitea"
|
||||||
|
|
||||||
|
# Linux binary
|
||||||
- |
|
- |
|
||||||
curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-F "name=Fig-linux" -F "file=@dist/Fig-linux" \
|
-F "name=Fig-linux" -F "file=@dist/Fig-linux" \
|
||||||
"https://git.fig-lang.cn/api/v1/repos/PuqiAR/Fig/releases/${TAG}/assets"
|
"https://git.fig-lang.cn/api/v1/repos/PuqiAR/Fig/releases/${TAG}/assets"
|
||||||
|
|
||||||
|
# Windows binary
|
||||||
- |
|
- |
|
||||||
curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-F "name=Fig-windows.exe" -F "file=@dist/Fig-windows.exe" \
|
-F "name=Fig-windows.exe" -F "file=@dist/Fig-windows.exe" \
|
||||||
|
|||||||
Reference in New Issue
Block a user