|
1 | 1 | name: Build and Release MiceWine RootFS |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: "*" |
4 | 6 | workflow_dispatch: |
5 | 7 |
|
6 | 8 | jobs: |
7 | 9 | build: |
8 | 10 |
|
9 | | - runs-on: ubuntu-22.04 |
| 11 | + runs-on: ubuntu-latest |
10 | 12 |
|
11 | 13 | steps: |
12 | | - - name: "Clone Repository" |
13 | | - run: | |
14 | | - git clone https://github.com/KreitinnSoftware/MiceWine-RootFS-Generator |
15 | 14 |
|
16 | | - - name: "Environment Preparation" |
| 15 | + - name: "Install ArchLinux" |
17 | 16 | run: | |
18 | 17 | sudo apt update |
19 | | - sudo apt install -y python3 python3-pip cmake wget git p7zip build-essential pkg-config xmlto fop xsltproc llvm autoconf libxml-parser-perl bison flex glslang-tools |
20 | | - pip3 install mako meson ninja docutils StrEnum |
21 | | - sudo ln -sf ~/.local/bin/meson /usr/bin/meson |
| 18 | + sudo apt install -y arch-install-scripts wget |
| 19 | + sudo mkdir -p /mnt/ |
| 20 | +
|
| 21 | + wget https://geo.mirror.pkgbuild.com/iso/2025.02.01/archlinux-bootstrap-x86_64.tar.zst |
| 22 | +
|
| 23 | + sudo tar -xf archlinux-bootstrap-x86_64.tar.zst |
| 24 | + sudo rm -f archlinux-bootstrap-x86_64.tar.zst |
| 25 | + sudo mv root.x86_64 /mnt/arch |
| 26 | +
|
| 27 | + sudo arch-chroot /mnt/arch bash -c "pacman-key --init && pacman-key --populate && sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist && sed -i "s/CheckSpace/#CheckSpace/g" /etc/pacman.conf && pacman -Syu --noconfirm base base-devel git cmake meson ninja bison flex python-pip wget python-mako python-pyyaml unzip 7zip glslang glib2-devel python-docutils xmlto fop libxslt python-docutils" |
| 28 | +
|
| 29 | + - name: "Checkout Repository" |
| 30 | + uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
22 | 33 |
|
23 | | - - name: "Setup Basic Android (x86_64) Runtime Environment" |
| 34 | + - name: "Copy Repository to Chroot" |
24 | 35 | run: | |
25 | | - git clone https://github.com/termux/termux-docker.git |
26 | | - sudo cp -rf termux-docker/system/x86 /system |
27 | | - sudo chown -R $(whoami):$(whoami) /system |
28 | | - sudo chmod 755 -R /system |
| 36 | + sudo cp -rf $PWD /mnt/arch/MiceWine-RootFS-Generator |
29 | 37 |
|
30 | 38 | - name: "Download Latest Release Rat Packages" |
31 | 39 | run: | |
32 | | - cd MiceWine-RootFS-Generator |
33 | 40 | curl -LO# https://github.com/KreitinnSoftware/MiceWine-RootFS-Generator/releases/download/$(curl -s https://api.github.com/repos/KreitinnSoftware/MiceWine-RootFS-Generator/releases | grep tag_name -m 1 | cut -d ":" -f 2 | sed "s/\"//g" | sed "s/,//g" | sed "s/ //g")/MiceWine-Packages.zip || true |
34 | | - unzip -o MiceWine-Packages.zip -d built-pkgs || true |
| 41 | + sudo unzip -o MiceWine-Packages.zip -d /mnt/arch/MiceWine-RootFS-Generator/built-pkgs || true |
| 42 | + rm -f MiceWine-Packages.zip |
| 43 | +
|
| 44 | + - name: "Setup Basic Android (x86_64) Runtime Environment (Required for Building x86_64 glib)" |
| 45 | + run: | |
| 46 | + git clone https://github.com/termux/termux-docker.git |
| 47 | + sudo cp -rf termux-docker/system/x86 /mnt/arch/system |
| 48 | + sudo chown -R $(whoami):$(whoami) /mnt/arch/system |
| 49 | + sudo chmod 755 -R /mnt/arch/system |
35 | 50 |
|
36 | 51 | - name: "Start Building (x86_64)" |
37 | 52 | run: | |
38 | | - cd MiceWine-RootFS-Generator |
39 | | - ./build-all.sh x86_64 --ci |
40 | | - cd logs |
41 | | - 7z a /home/runner/MiceWine-RootFS-x86_64-Logs.zip |
| 53 | + sudo arch-chroot /mnt/arch bash -c "cd /MiceWine-RootFS-Generator && ./build-all.sh x86_64 --ci && cd logs && 7z a /MiceWine-RootFS-x86_64-Logs.zip" |
42 | 54 |
|
43 | 55 | - name: "Create RootFS File (x86_64)" |
44 | 56 | run: | |
45 | | - cd MiceWine-RootFS-Generator |
46 | | - ./create-rootfs.sh x86_64 |
47 | | - mv "MiceWine-RootFS-($(git rev-parse --short HEAD))-x86_64.rat" /home/runner/MiceWine-RootFS-x86_64.rat |
| 57 | + sudo arch-chroot /mnt/arch bash -c "cd /MiceWine-RootFS-Generator && ./create-rootfs.sh x86_64 && mv MiceWine-RootFS-\($(git rev-parse --short HEAD)\)-x86_64.rat /MiceWine-RootFS-x86_64.rat" |
48 | 58 |
|
49 | 59 | - name: "Clean (x86_64) RootFS" |
50 | 60 | run: | |
51 | | - cd MiceWine-RootFS-Generator |
52 | | - sudo rm -rf /data/data/com.micewine.emu/files/usr workdir rootfs |
| 61 | + sudo rm -rf /mnt/arch/data /mnt/arch/MiceWine-RootFS-Generator/workdir /mnt/arch/MiceWine-RootFS-Generator/rootfs |
53 | 62 |
|
54 | 63 | - name: "Start Building (aarch64)" |
55 | 64 | run: | |
56 | | - cd MiceWine-RootFS-Generator |
57 | | - ./build-all.sh aarch64 --ci |
58 | | - cd logs |
59 | | - 7z a /home/runner/MiceWine-RootFS-aarch64-Logs.zip |
| 65 | + sudo arch-chroot /mnt/arch bash -c "cd /MiceWine-RootFS-Generator && ./build-all.sh aarch64 --ci && cd logs && 7z a /MiceWine-RootFS-aarch64-Logs.zip" |
60 | 66 |
|
61 | | - - name: "Save All Rat Packages (for next build be faster)" |
| 67 | + - name: "Create RootFS File (aarch64)" |
62 | 68 | run: | |
63 | | - cd MiceWine-RootFS-Generator |
64 | | - cd built-pkgs |
65 | | - 7z a /home/runner/MiceWine-Packages.zip |
66 | | - cd .. |
| 69 | + sudo arch-chroot /mnt/arch bash -c "cd /MiceWine-RootFS-Generator && ./create-rootfs.sh aarch64 && mv MiceWine-RootFS-\($(git rev-parse --short HEAD)\)-aarch64.rat /MiceWine-RootFS-aarch64.rat" |
67 | 70 |
|
68 | | - - name: "Create RootFS File (aarch64)" |
| 71 | + - name: "Save Rat Packages" |
69 | 72 | run: | |
70 | | - cd MiceWine-RootFS-Generator |
71 | | - ./create-rootfs.sh aarch64 |
72 | | - mv "MiceWine-RootFS-($(git rev-parse --short HEAD))-aarch64.rat" /home/runner/MiceWine-RootFS-aarch64.rat |
| 73 | + sudo arch-chroot /mnt/arch bash -c "cd /MiceWine-RootFS-Generator/built-pkgs && 7z a /MiceWine-Packages.zip" |
73 | 74 |
|
74 | 75 | - name: "Get Short SHA" |
75 | 76 | run: | |
76 | | - cd MiceWine-RootFS-Generator |
77 | 77 | echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
78 | 78 |
|
79 | 79 | - name: "Create Release" |
|
83 | 83 | tag_name: ${{ env.SHORT_SHA }} |
84 | 84 | prerelease: true |
85 | 85 | files: | |
86 | | - /home/runner/MiceWine-RootFS-aarch64.rat |
87 | | - /home/runner/MiceWine-RootFS-aarch64-Logs.zip |
88 | | - /home/runner/MiceWine-Packages.zip |
89 | | - /home/runner/MiceWine-RootFS-x86_64.rat |
90 | | - /home/runner/MiceWine-RootFS-x86_64-Logs.zip |
| 86 | + /mnt/arch/MiceWine-RootFS-aarch64.rat |
| 87 | + /mnt/arch/MiceWine-RootFS-aarch64-Logs.zip |
| 88 | + /mnt/arch/MiceWine-Packages.zip |
| 89 | + /mnt/arch/MiceWine-RootFS-x86_64.rat |
| 90 | + /mnt/arch/MiceWine-RootFS-x86_64-Logs.zip |
91 | 91 |
|
0 commit comments