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:
event: tag
event:
include: [ tag ]
steps:
linux-build:
when:
platform: linux
setup:
image: debian:stable
environment:
VERSION: ${CI_COMMIT_TAG}
commands:
- apt update
- apt install -y git build-essential curl xz-utils
- curl -fsSL https://xmake.io/shget.text | bash
- export PATH=$PATH:/root/.xmake
- apt-get update
- apt-get install -y xmake mingw-w64 zip git
- xmake --version
- xmake f -m release
# =========================
# Linux Build
# =========================
linux-build:
image: debian:stable
commands:
- xmake f -p linux -m release
- xmake
- 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
- cd dist
- tar -czf Fig-${VERSION}-linux.tar.gz linux
- cd dist && zip -r fig-linux-${CI_COMMIT_TAG}.zip linux
# =========================
# Windows (Mingw) Build
# =========================
windows-build:
when:
platform: windows
environment:
VERSION: ${CI_COMMIT_TAG}
image: debian:stable
commands:
- choco install -y git
- choco install -y xmake
- refreshenv
- xmake f -m release
- xmake f -p mingw -m release
- xmake
- mkdir dist
- mkdir dist/windows
- copy build\windows\x64\release\Fig.exe dist\windows\
- xcopy src\Module\Library dist\windows\Library /E /I
- powershell Compress-Archive dist/windows Fig-%VERSION%-windows.zip
- mkdir -p dist/windows
- cp build/mingw/x86_64/release/Fig.exe dist/windows/Fig.exe
- cp -r src/Module/Library dist/windows/Library
- cd dist && zip -r fig-windows-${CI_COMMIT_TAG}.zip windows
# =========================
# 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

@@ -5,10 +5,13 @@ set_policy("run.autobuild", false)
target("Fig")
set_kind("binary")
set_languages("c++23")
set_languages("c++23")
if is_plat("windows") then
set_plat("mingw")
end
if is_plat("mingw") then
add_cxxflags("-static")
add_cxxflags("-stdlib=libc++")
add_ldflags("-Wl,--stack,268435456")
@@ -20,7 +23,7 @@ target("Fig")
add_files("src/Lexer/lexer.cpp")
add_files("src/Parser/parser.cpp")
add_files("src/Value/value.cpp")
add_includedirs("src")
set_warnings("all")