Winlator Rootfs Build (use BCC) #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Winlator Rootfs Build (use BCC) | |
| 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: true | |
| default: "" | |
| inputWineAmd64URL: | |
| description: "输入 Wine AMD64 下载 URL:" | |
| required: true | |
| 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: BCC | |
| run: | | |
| echo "gstreamer ${gstVer}" | |
| curl -L -O "https://github.com/Waim908/BCC/releases/download/wlt-bcc-latest/wlt-bcc.tar.xz" | |
| sudo tar xf wlt-bcc.tar.xz -C /tmp | |
| cd /tmp | |
| git clone https://github.com/Waim908/rootfs-winlator.git | |
| sudo cp rootfs-winlator-glibc/build-rootfs.sh /tmp/archlinux/bin | |
| mv rootfs-winlator-glibc/data.tar.xz /tmp/archlinux/tmp | |
| mv rootfs-winlator-glibc/tzdata-*-1-aarch64.pkg.tar.xz /tmp/archlinux/tmp | |
| mv rootfs-winlator-glibc/patches /tmp/archlinux/tmp | |
| mv rootfs-winlator-glibc/mangohud.tar.xz /tmp/archlinux/tmp | |
| # mv rootfs-winlator-glibc/lame-3.100 /tmp/archlinux/tmp | |
| # 复制 ccache 缓存到 chroot 环境(如果存在) | |
| if [[ -f /tmp/ccache.tar.xz ]]; then | |
| echo "复制 ccache 到 chroot 环境..." | |
| sudo cp /tmp/ccache.tar.xz /tmp/archlinux/tmp/ | |
| fi | |
| sudo chmod +x /tmp/archlinux/bin/build-rootfs.sh | |
| # sudo chmod 777 /tmp/archlinux/tmp | |
| # cd /tmp/archlinux/tmp | |
| # git clone -b ${gstVer} https://gitlab.freedesktop.org/gstreamer/gstreamer.git gstreamer-src | |
| # cd /tmp | |
| cat > /tmp/archlinux/tmp/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 | |
| #export monoVer=$monoVer | |
| #export geckoVer=$geckoVer | |
| EOF | |
| # echo "export gstVer=$gstVer" > /tmp/archlinux/tmp/init.sh | |
| # echo "export xzVer=$xzVer" >> /tmp/archlinux/tmp/init.sh | |
| # echo "export vorbisVer=$vorbisVer" >> /tmp/archlinux/tmp/init.sh | |
| sudo mount --bind /proc archlinux/proc | |
| sudo mount --bind /sys archlinux/sys | |
| sudo mount --bind /dev archlinux/dev | |
| if ! sudo chroot /tmp/archlinux /bin/build-rootfs.sh; then | |
| echo "失败" | |
| exit 1 | |
| fi | |
| sudo umount -l archlinux/dev | |
| sudo umount -l archlinux/sys | |
| sudo umount -l archlinux/proc | |
| - name: Copy ccache from chroot | |
| run: | | |
| # 从 chroot 环境中复制打包好的 ccache | |
| if [[ -f /tmp/archlinux/tmp/ccache.tar.xz ]]; then | |
| echo "复制 ccache 从 chroot 环境..." | |
| sudo cp /tmp/archlinux/tmp/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 "警告: chroot 环境中没有找到 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.txz` put to apk/assets/imagefs.txz | |
| files: | | |
| /tmp/archlinux/tmp/output/output-lite-${{ github.event.inputs.inputCustomTag }}.tar.xz | |
| /tmp/archlinux/tmp/output/output-full-${{ github.event.inputs.inputCustomTag }}.tar.xz | |
| /tmp/archlinux/tmp/output/imagefs-${{ github.event.inputs.inputCustomTag }}.tzst | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |