文件
PazeE-Language/.github/workflows/build-linux.yml
T
JGZ_YES 9ab3a0225b ci: add Linux build workflow + los4 GUI fixes + bump to 0.1.1
- Add .github/workflows/build-linux.yml: auto-build self-contained
  linux-x64 paze on push/tag, smoke-test with hello.pe, publish
  tar.gz+zip artifacts and GitHub Release on v* tags.

- Fix LeonOS 4 (los4) syscalls: use int 0x80 (0xCD 0x80) instead of
  syscall (0x0F 0x05) in Los4Runtime and StartupStubs, matching the
  real doomlauncher.elf ABI.

- Fix X64CodeGenerator GenCallArgs: allocate spill slots for register
  arguments under SysV ABI to avoid overwriting caller stack temporaries
  (was clobbering &gui_fb during malloc call).

- Fix los4 malloc/calloc: switch from unsupported SYS_mmap to a 1MB
  BSS static heap pool with bump pointer allocation.

- Fix ElfWriterLos4 WritePhdr: resolve Write64At overload ambiguity
  that corrupted the program header table and left holes in .text.

- Fix los4 GUI: use PRESENT_WINDOW ioctl with self-rendered framebuffer
  (8x16 font + ARGB32 color format), correct app_event struct layout
  (35 bytes, no trailing reserved field).

- Bump version 0.1.0 -> 0.1.1 (csproj, wixproj, Product.wxs install
  dir + registry paths).
2026-08-03 19:44:40 +08:00

136 行
4.3 KiB
YAML

name: build-linux
on:
push:
branches: [ main, master ]
tags: [ 'v*' ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
build:
name: Build paze for Linux x64
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Restore
run: dotnet restore src/PazeE.Compiler/PazeE.Compiler.csproj
- name: Determine channel & version
id: meta
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
CHANNEL="release"
else
CHANNEL="alpha"
fi
VERSION=$(dotnet msbuild src/PazeE.Compiler/PazeE.Compiler.csproj \
-p:BuildChannel=$CHANNEL \
-getProperty:Version \
-nologo)
echo "channel=$CHANNEL" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Channel: $CHANNEL Version: $VERSION"
- name: Publish (self-contained, linux-x64)
run: |
dotnet publish src/PazeE.Compiler/PazeE.Compiler.csproj \
-c Release \
-p:BuildChannel=${{ steps.meta.outputs.channel }} \
-r linux-x64 \
--self-contained true \
-p:PublishSingleFile=true \
-p:EnableCompressionInSingleFile=true
- name: Stage artifacts
run: |
STAGE="staging/paze-${{ steps.meta.outputs.version }}-linux-x64"
mkdir -p "$STAGE/bin"
cp -v publish/${{ steps.meta.outputs.version }}/bin/* "$STAGE/bin/" 2>/dev/null || true
# 单文件模式下 paze 主程序即 paze.dll/paze.exe → 重命名为 paze
if [ -f "$STAGE/bin/paze" ]; then
chmod +x "$STAGE/bin/paze"
fi
# 包含测试源文件以便验证
mkdir -p "$STAGE/tests"
cp -v tests/*.pe "$STAGE/tests/" 2>/dev/null || true
# 生成版本说明
cat > "$STAGE/VERSION.txt" <<EOF
PazeE Compiler
Version: ${{ steps.meta.outputs.version }}
Channel: ${{ steps.meta.outputs.channel }}
Target: linux-x64 (self-contained .NET 10)
Commit: ${GITHUB_SHA}
Built: ${GITHUB_RUN_ID}
EOF
# 打包
cd staging
tar -czf ../paze-${{ steps.meta.outputs.version }}-linux-x64.tar.gz *
zip -r -q ../paze-${{ steps.meta.outputs.version }}-linux-x64.zip *
cd ..
ls -lh paze-*.tar.gz paze-*.zip
- name: Smoke test — compile hello.pe
run: |
BIN="staging/paze-${{ steps.meta.outputs.version }}-linux-x64/bin"
if [ -f "$BIN/paze" ]; then
"$BIN/paze" tests/hello.pe --target linux -o /tmp/hello.elf
file /tmp/hello.elf
/tmp/hello.elf || true
elif [ -f "$BIN/paze.dll" ]; then
dotnet "$BIN/paze.dll" tests/hello.pe --target linux -o /tmp/hello.elf
file /tmp/hello.elf
/tmp/hello.elf || true
else
echo "WARN: paze binary not found, listing bin/:"
ls -la "$BIN"
fi
- name: Upload artifact (tar.gz)
uses: actions/upload-artifact@v4
with:
name: paze-${{ steps.meta.outputs.version }}-linux-x64-tar
path: paze-${{ steps.meta.outputs.version }}-linux-x64.tar.gz
if-no-files-found: error
- name: Upload artifact (zip)
uses: actions/upload-artifact@v4
with:
name: paze-${{ steps.meta.outputs.version }}-linux-x64-zip
path: paze-${{ steps.meta.outputs.version }}-linux-x64.zip
if-no-files-found: error
release:
name: Publish GitHub Release
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: PazeE ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
files: |
artifacts/**/*.tar.gz
artifacts/**/*.zip