ci(linux): add ARM64 build via native ubuntu-24.04-arm runner
Public repo uses free GitHub ARM64 runners. Matrix now builds: - linux-x64 on ubuntu-latest (native) - linux-arm64 on ubuntu-24.04-arm (native) Both produce self-contained single-file paze + tar.gz/zip artifacts. ARM64 smoke test uses --arch arm to compile and run an ARM64 ELF natively. Release job automatically picks up all arch artifacts on v* tag push.
这个提交包含在:
@@ -10,8 +10,19 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build paze for Linux x64
|
name: Build paze for Linux (${{ matrix.arch }})
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# 公共仓库可免费使用 ubuntu-24.04-arm 原生 ARM64 runner。
|
||||||
|
- arch: x64
|
||||||
|
runner: ubuntu-latest
|
||||||
|
rid: linux-x64
|
||||||
|
- arch: arm64
|
||||||
|
runner: ubuntu-24.04-arm
|
||||||
|
rid: linux-arm64
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -42,19 +53,19 @@ jobs:
|
|||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
echo "Channel: $CHANNEL Version: $VERSION"
|
echo "Channel: $CHANNEL Version: $VERSION"
|
||||||
|
|
||||||
- name: Publish (self-contained, linux-x64)
|
- name: Publish (self-contained, ${{ matrix.rid }})
|
||||||
run: |
|
run: |
|
||||||
dotnet publish src/PazeE.Compiler/PazeE.Compiler.csproj \
|
dotnet publish src/PazeE.Compiler/PazeE.Compiler.csproj \
|
||||||
-c Release \
|
-c Release \
|
||||||
-p:BuildChannel=${{ steps.meta.outputs.channel }} \
|
-p:BuildChannel=${{ steps.meta.outputs.channel }} \
|
||||||
-r linux-x64 \
|
-r ${{ matrix.rid }} \
|
||||||
--self-contained true \
|
--self-contained true \
|
||||||
-p:PublishSingleFile=true \
|
-p:PublishSingleFile=true \
|
||||||
-p:EnableCompressionInSingleFile=true
|
-p:EnableCompressionInSingleFile=true
|
||||||
|
|
||||||
- name: Stage artifacts
|
- name: Stage artifacts
|
||||||
run: |
|
run: |
|
||||||
STAGE="staging/paze-${{ steps.meta.outputs.version }}-linux-x64"
|
STAGE="staging/paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}"
|
||||||
mkdir -p "$STAGE/bin"
|
mkdir -p "$STAGE/bin"
|
||||||
cp -v publish/${{ steps.meta.outputs.version }}/bin/* "$STAGE/bin/" 2>/dev/null || true
|
cp -v publish/${{ steps.meta.outputs.version }}/bin/* "$STAGE/bin/" 2>/dev/null || true
|
||||||
# 单文件模式下 paze 主程序即 paze.dll/paze.exe → 重命名为 paze
|
# 单文件模式下 paze 主程序即 paze.dll/paze.exe → 重命名为 paze
|
||||||
@@ -69,26 +80,29 @@ jobs:
|
|||||||
PazeE Compiler
|
PazeE Compiler
|
||||||
Version: ${{ steps.meta.outputs.version }}
|
Version: ${{ steps.meta.outputs.version }}
|
||||||
Channel: ${{ steps.meta.outputs.channel }}
|
Channel: ${{ steps.meta.outputs.channel }}
|
||||||
Target: linux-x64 (self-contained .NET 10)
|
Target: ${{ matrix.rid }} (self-contained .NET 10)
|
||||||
Commit: ${GITHUB_SHA}
|
Commit: ${GITHUB_SHA}
|
||||||
Built: ${GITHUB_RUN_ID}
|
Built: ${GITHUB_RUN_ID}
|
||||||
EOF
|
EOF
|
||||||
# 打包
|
# 打包
|
||||||
cd staging
|
cd staging
|
||||||
tar -czf ../paze-${{ steps.meta.outputs.version }}-linux-x64.tar.gz *
|
tar -czf ../paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}.tar.gz *
|
||||||
zip -r -q ../paze-${{ steps.meta.outputs.version }}-linux-x64.zip *
|
zip -r -q ../paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}.zip *
|
||||||
cd ..
|
cd ..
|
||||||
ls -lh paze-*.tar.gz paze-*.zip
|
ls -lh paze-*.tar.gz paze-*.zip
|
||||||
|
|
||||||
- name: Smoke test — compile hello.pe
|
- name: Smoke test — compile hello.pe
|
||||||
|
env:
|
||||||
|
# arm64 构建用 --arch arm 产出 ARM64 ELF;x64 用默认 AMD64。
|
||||||
|
ARCH_FLAG: ${{ matrix.arch == 'arm64' && '--arch arm' || '' }}
|
||||||
run: |
|
run: |
|
||||||
BIN="staging/paze-${{ steps.meta.outputs.version }}-linux-x64/bin"
|
BIN="staging/paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}/bin"
|
||||||
if [ -f "$BIN/paze" ]; then
|
if [ -f "$BIN/paze" ]; then
|
||||||
"$BIN/paze" tests/hello.pe --target linux -o /tmp/hello.elf
|
"$BIN/paze" tests/hello.pe --target linux $ARCH_FLAG -o /tmp/hello.elf
|
||||||
file /tmp/hello.elf
|
file /tmp/hello.elf
|
||||||
/tmp/hello.elf || true
|
/tmp/hello.elf || true
|
||||||
elif [ -f "$BIN/paze.dll" ]; then
|
elif [ -f "$BIN/paze.dll" ]; then
|
||||||
dotnet "$BIN/paze.dll" tests/hello.pe --target linux -o /tmp/hello.elf
|
dotnet "$BIN/paze.dll" tests/hello.pe --target linux $ARCH_FLAG -o /tmp/hello.elf
|
||||||
file /tmp/hello.elf
|
file /tmp/hello.elf
|
||||||
/tmp/hello.elf || true
|
/tmp/hello.elf || true
|
||||||
else
|
else
|
||||||
@@ -99,15 +113,15 @@ jobs:
|
|||||||
- name: Upload artifact (tar.gz)
|
- name: Upload artifact (tar.gz)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: paze-${{ steps.meta.outputs.version }}-linux-x64-tar
|
name: paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}-tar
|
||||||
path: paze-${{ steps.meta.outputs.version }}-linux-x64.tar.gz
|
path: paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}.tar.gz
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload artifact (zip)
|
- name: Upload artifact (zip)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: paze-${{ steps.meta.outputs.version }}-linux-x64-zip
|
name: paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}-zip
|
||||||
path: paze-${{ steps.meta.outputs.version }}-linux-x64.zip
|
path: paze-${{ steps.meta.outputs.version }}-linux-${{ matrix.arch }}.zip
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户