|
16 | 16 | # Allows you to run this workflow manually from the Actions tab. |
17 | 17 | workflow_dispatch: |
18 | 18 |
|
19 | | -env: |
20 | | - DEVKITPRO: "/opt/devkitpro" |
21 | | - DEVKITARM: "/opt/devkitpro/devkitARM" |
22 | | - DEVKITPPC: "/opt/devkitpro/devkitPPC" |
23 | | - |
24 | 19 | jobs: |
25 | 20 | build: |
26 | 21 | runs-on: ubuntu-latest |
27 | | - # Skip build with [ci skip] in commit |
28 | | - if: "! contains(github.event.head_commit.message, '[ci skip]')" |
29 | 22 | container: |
30 | 23 | image: devkitpro/devkita64 |
31 | 24 | steps: |
32 | 25 | # Workaround: avoid requesting data from devkitPro servers because they ban most CI/CD scripts. |
| 26 | + # TODO: Remove the last dkp-pacman invocation if https://github.com/devkitPro/docker/pull/28 gets accepted |
33 | 27 | - name: Update packages |
34 | 28 | run: | |
35 | 29 | sudo -n apt-get update |
36 | 30 | sudo -n apt-get upgrade -y patch autoconf automake tar bzip2 diffutils pkgconf fakeroot git file zstd |
37 | 31 | sudo -n dkp-pacman --noconfirm -U \ |
38 | | - "https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.3-2-any.pkg.tar.zst" \ |
39 | | - "https://wii.leseratte10.de/devkitPro/cmake/switch-cmake-1.5.0-1-any.pkg.tar.xz" |
40 | | - # "https://wii.leseratte10.de/devkitPro/switch/switch-libjson-c-0.16-1-any.pkg.tar.xz" \ |
41 | | - # "https://wii.leseratte10.de/devkitPro/switch/switch-libpng-1.6.39-2-any.pkg.tar.zst" \ |
42 | | - # "https://wii.leseratte10.de/devkitPro/switch/switch-zlib-1.2.13-1-any.pkg.tar.xz" |
43 | | - |
44 | | - - name: Silence all git safe directory warnings |
45 | | - run: git config --system --add safe.directory '*' |
| 32 | + "https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.3-2-any.pkg.tar.zst" |
46 | 33 |
|
47 | | - # Workaround: manually use git instead of actions/checkout to parse repository properties (e.g. branch name, commit hash, etc.) on our own. |
48 | | - - name: Checkout latest nxdumptool-rewrite commit |
49 | | - run: | |
50 | | - cd "$GITHUB_WORKSPACE" |
51 | | - git clone --branch rewrite --recurse-submodules https://github.com/DarkMatterCore/nxdumptool.git |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + path: nxdumptool |
| 37 | + submodules: recursive |
52 | 38 |
|
53 | 39 | - name: Checkout latest libnx commit |
54 | | - run: | |
55 | | - cd "$GITHUB_WORKSPACE" |
56 | | - git clone --recurse-submodules https://github.com/switchbrew/libnx.git |
| 40 | + uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + repository: switchbrew/libnx |
| 43 | + path: libnx |
| 44 | + submodules: recursive |
57 | 45 |
|
58 | 46 | - name: Set workspace permissions |
59 | 47 | run: chmod 777 -R "$GITHUB_WORKSPACE" |
60 | 48 |
|
61 | 49 | - name: Build and install libnx |
| 50 | + working-directory: libnx |
62 | 51 | run: | |
63 | | - cd "$GITHUB_WORKSPACE/libnx" |
64 | 52 | make install -j$(nproc) |
65 | 53 |
|
66 | | - # Workaround: dkp-makepkg's "-i" option fails because it tries to run pacman as root on its own using sudo, and a password must be interactively provided. |
67 | | - # We can't just provide root access to dkp-makepkg because it refuses to work at all if we do so. |
68 | | - # As much as I'd like to run "make fs-libs" and call it a day, it's just not possible. |
69 | 54 | - name: Build libusbhsfs dependencies |
| 55 | + working-directory: nxdumptool/libs/libusbhsfs |
70 | 56 | run: | |
71 | | - cd "$GITHUB_WORKSPACE/nxdumptool/libs/libusbhsfs" |
72 | | - cd libntfs-3g; su -s /bin/bash nobody -c "dkp-makepkg -c -C -f" > /dev/null; sudo -n dkp-pacman -U --needed --noconfirm *.pkg.tar.* > /dev/null; cd .. |
73 | | - cd liblwext4; su -s /bin/bash nobody -c "dkp-makepkg -c -C -f" > /dev/null; sudo -n dkp-pacman -U --needed --noconfirm *.pkg.tar.* > /dev/null; cd .. |
| 57 | + make fs-libs |
74 | 58 |
|
75 | 59 | - name: Build nxdumptool-rewrite PoC binary |
| 60 | + working-directory: nxdumptool |
76 | 61 | run: | |
77 | | - cd "$GITHUB_WORKSPACE/nxdumptool" |
78 | | - echo "nxdt_commit=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 62 | + echo "nxdt_commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV |
79 | 63 | ./build.sh |
80 | 64 |
|
81 | 65 | #- name: Build nxdumptool-rewrite GUI binary |
|
0 commit comments