test build again! again!

This commit is contained in:
2026-01-02 16:48:10 +08:00
parent 3252344911
commit 4dca435307
2 changed files with 44 additions and 30 deletions

View File

@@ -1,41 +1,52 @@
when: when:
event: tag event:
include: [ tag ]
steps: steps:
linux-build: setup:
when:
platform: linux
image: debian:stable image: debian:stable
environment:
VERSION: ${CI_COMMIT_TAG}
commands: commands:
- apt update - apt-get update
- apt install -y git build-essential curl xz-utils - apt-get install -y xmake mingw-w64 zip git
- curl -fsSL https://xmake.io/shget.text | bash
- export PATH=$PATH:/root/.xmake
- xmake --version - xmake --version
- xmake f -m release
# =========================
# Linux Build
# =========================
linux-build:
image: debian:stable
commands:
- xmake f -p linux -m release
- xmake - xmake
- mkdir -p dist/linux - mkdir -p dist/linux
- cp build/linux/x64/release/Fig dist/linux/ - cp build/linux/x86_64/release/Fig dist/linux/Fig
- cp -r src/Module/Library dist/linux/Library - cp -r src/Module/Library dist/linux/Library
- cd dist - cd dist && zip -r fig-linux-${CI_COMMIT_TAG}.zip linux
- tar -czf Fig-${VERSION}-linux.tar.gz linux
# =========================
# Windows (Mingw) Build
# =========================
windows-build: windows-build:
when: image: debian:stable
platform: windows
environment:
VERSION: ${CI_COMMIT_TAG}
commands: commands:
- choco install -y git - xmake f -p mingw -m release
- choco install -y xmake
- refreshenv
- xmake f -m release
- xmake - xmake
- mkdir dist - mkdir -p dist/windows
- mkdir dist/windows - cp build/mingw/x86_64/release/Fig.exe dist/windows/Fig.exe
- copy build\windows\x64\release\Fig.exe dist\windows\ - cp -r src/Module/Library dist/windows/Library
- xcopy src\Module\Library dist\windows\Library /E /I - cd dist && zip -r fig-windows-${CI_COMMIT_TAG}.zip windows
- powershell Compress-Archive dist/windows Fig-%VERSION%-windows.zip
# =========================
# Upload to Gitea Release
# =========================
release:
image: woodpeckerci/plugin-gitea-release
settings:
api_key:
from_secret: GITEA_TOKEN
base_url: https://git.fig-lang.cn
files:
- dist/fig-linux-${CI_COMMIT_TAG}.zip
- dist/fig-windows-${CI_COMMIT_TAG}.zip
note: "Automated build for ${CI_COMMIT_TAG}"

View File

@@ -9,6 +9,9 @@ target("Fig")
if is_plat("windows") then if is_plat("windows") then
set_plat("mingw") set_plat("mingw")
end
if is_plat("mingw") then
add_cxxflags("-static") add_cxxflags("-static")
add_cxxflags("-stdlib=libc++") add_cxxflags("-stdlib=libc++")
add_ldflags("-Wl,--stack,268435456") add_ldflags("-Wl,--stack,268435456")