Skip to content

Winlator Rootfs Build (use Docker) #3

Winlator Rootfs Build (use Docker)

Winlator Rootfs Build (use Docker) #3

name: Winlator Rootfs Build (use Docker)
permissions:
contents: write
# https://xorg.freedesktop.org/archive/individual/data/xkeyboard-config/
# https://xorg.freedesktop.org/releases/individual/lib/
on:
workflow_dispatch:
inputs:
inputGstVersion:
description: "输入gstreamer版本:"
required: true
default: "1.28.1"
inputXzVersion:
description: "输入xz版本:"
required: true
default: "v5.8.1"
inputFlacVersion:
description: "输入flac版本:"
required: true
default: "1.5.0"
inputXkbcommonVersion:
description: "输入xkbcommon的版本:"
required: true
default: "xkbcommon-1.13.0"
inputMangohudVersion:
description: "输入MangoHud版本:"
required: true
default: "cmod"
inputGlibVersion:
description: "输入glib版本:"
required: true
default: "2.86.3"
# inputMonoVersion:
# description: "mono版本:"
# required: true
# default: "10.3.0"
# inputGeckoVersion:
# description: "gecko:版本:"
# required: true
# default: "2.47.4"
inputCustomTag:
description: "输入自定义Tag名称:"
required: true
default: "glibc2.39-"
inputWineArm64ecURL:
description: "输入 Wine ARM64EC 下载 URL:"
required: false
default: ""
inputWineAmd64URL:
description: "输入 Wine AMD64 下载 URL:"
required: false
default: ""
env:
gstVer: ${{ github.event.inputs.inputGstVersion }}
xzVer: ${{ github.event.inputs.inputXzVersion }}
xkbcommonVer: ${{ github.event.inputs.inputXkbcommonVersion }}
mangohudVer: ${{ github.event.inputs.inputMangohudVersion }}
customTag: ${{ github.event.inputs.inputCustomTag }}
glibVer: ${{ github.event.inputs.inputGlibVersion }}
flacVer: ${{ github.event.inputs.inputFlacVersion }}
wineArm64ecURL: ${{ github.event.inputs.inputWineArm64ecURL }}
wineAmd64URL: ${{ github.event.inputs.inputWineAmd64URL }}
#monoVer: ${{ github.event.inputs.inputMonoVersion }}
#geckoVer: ${{ github.event.inputs.inputGeckoVersion }}
jobs:
BCC:
runs-on: ubuntu-24.04-arm
steps:
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v4
with:
path: /tmp/ccache.tar.xz
key: ccache-${{ github.event.inputs.inputGstVersion }}-${{ github.event.inputs.inputGlibVersion }}-${{ github.event.inputs.inputXzVersion }}
restore-keys: |
ccache-${{ github.event.inputs.inputGstVersion }}-
ccache-
- name: Check ccache exists
run: |
if [[ -f /tmp/ccache.tar.xz ]]; then
echo "ccache 缓存已恢复"
ls -lh /tmp/ccache.tar.xz
else
echo "ccache 缓存不存在,将创建新的缓存"
fi
- name: Docker
run: |
mkdir /tmp/archlinux/
sudo docker run -itd --name arch -v /tmp/archlinux/tmp2:/tmp waim908/archlinuxarm:wlt bash || { echo 容器创建失败 && exit 1;}
cd /tmp
git clone --depth=1 https://github.com/Waim908/rootfs-winlator.git
sudo chmod 777 rootfs-winlator/*
sudo cp rootfs-winlator/build-rootfs.sh /tmp/archlinux/tmp2
sudo mv rootfs-winlator/data.tar.xz /tmp/archlinux/tmp2
sudo mv rootfs-winlator/tzdata-*-1-aarch64.pkg.tar.xz /tmp/archlinux/tmp2
sudo mv rootfs-winlator/patches /tmp/archlinux/tmp2
sudo mv rootfs-winlator/mangohud.tar.xz /tmp/archlinux/tmp2
# 复制 ccache 缓存
if [[ -f /tmp/ccache.tar.xz ]]; then
echo "复制 ccache 到 chroot 环境..."
sudo cp /tmp/ccache.tar.xz /tmp/archlinux/tmp2/
fi
cat > /tmp/archlinux/tmp2/init.sh << EOF
export gstVer=$gstVer
export xzVer=$xzVer
export xkbcommonVer=$xkbcommonVer
export mangohudVer=$mangohudVer
export customTag=$customTag
export flacVer=$flacVer
export glibVer=$glibVer
export wineArm64ecURL=$wineArm64ecURL
export wineAmd64URL=$wineAmd64URL
EOF
sudo docker exec arch bash -x /tmp/build-rootfs.sh || exit 1
sudo chmod 644 /tmp/archlinux/tmp2/output/*
- name: Copy ccache from docker
run: |
# 从 docker 环境中复制打包好的 ccache
if [[ -f /tmp/archlinux/tmp2/ccache.tar.xz ]]; then
echo "复制 ccache 从 chroot 环境..."
sudo cp /tmp/archlinux/tmp2/ccache.tar.xz /tmp/ccache-new.tar.xz
sudo chmod 777 /tmp/ccache-new.tar.xz
ls -lh /tmp/ccache-new.tar.xz
else
echo "警告: docker 环境中没有找到 ccache.tar.xz"
fi
- name: Save ccache
if: always()
uses: actions/cache/save@v4
with:
path: /tmp/ccache-new.tar.xz
key: ccache-${{ github.event.inputs.inputGstVersion }}-${{ github.event.inputs.inputGlibVersion }}-${{ github.event.inputs.inputXzVersion }}-${{ github.run_id }}
# - name: Package
# run: |
# cd /tmp/archlinux/data/data/com.termux/files/usr
# tar -I "xz -T$(nproc)" -cvf /tmp/gstreamer-${gstVer}.tar.xz glibc/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: rootfs-${{ github.event.inputs.inputCustomTag }}
draft: false
prerelease: false
tag_name: rootfs-${{ github.event.inputs.inputCustomTag }}
body: |
xz=> ${{ github.event.inputs.inputXzVersion }}
libFLAC=> ${{ github.event.inputs.inputFlacVersion }}
gstreamer=> ${{ github.event.inputs.inputGstVersion }}
xkbcommon=> ${{ github.event.inputs.inputXkbcommonVersion }}
glib=> ${{ github.event.inputs.inputGlibVersion }}
MangoHud=> ${{ github.event.inputs.inputMangohudVersion }}
customTag=> ${{ github.event.inputs.inputCustomTag }}
...
run on winlator 7.1.6+
wine amd64:
wine arm64:
more info look '_version_.txt' for imagefs
Rename to `imagefs.tzst` put to apk/assets/imagefs.tzst
files: |
/tmp/archlinux/tmp2/output/output-lite-${{ github.event.inputs.inputCustomTag }}.tar.xz
/tmp/archlinux/tmp2/output/output-full-${{ github.event.inputs.inputCustomTag }}.tar.xz
/tmp/archlinux/tmp2/output/imagefs-${{ github.event.inputs.inputCustomTag }}.tzst
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}