2023-03-24 23:39:34 +00:00
|
|
|
name: Build nxdumptool-rewrite binaries
|
2022-02-09 04:52:04 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ rewrite ]
|
|
|
|
|
2023-03-20 15:58:00 +00:00
|
|
|
# Allows you to run this workflow manually from the Actions tab.
|
2022-02-09 04:52:04 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
2023-03-20 15:58:00 +00:00
|
|
|
env:
|
|
|
|
DEVKITPRO: "/opt/devkitpro"
|
|
|
|
DEVKITARM: "/opt/devkitpro/devkitARM"
|
|
|
|
DEVKITPPC: "/opt/devkitpro/devkitPPC"
|
|
|
|
|
2022-02-09 04:52:04 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: devkitpro/devkita64
|
|
|
|
steps:
|
2023-03-20 18:15:59 +00:00
|
|
|
# Workaround: avoid requesting data from devkitPro servers because they ban most CI/CD scripts.
|
2023-03-20 15:58:00 +00:00
|
|
|
- name: Update packages
|
|
|
|
run: |
|
|
|
|
sudo -n apt-get update
|
|
|
|
sudo -n apt-get upgrade -y patch autoconf automake tar bzip2 diffutils pkgconf fakeroot p7zip-full git
|
2023-03-25 11:10:07 +00:00
|
|
|
sudo -n dkp-pacman --noconfirm -U \
|
|
|
|
"https://wii.leseratte10.de/devkitPro/switch/switch-libjson-c-0.16-1-any.pkg.tar.xz" \
|
|
|
|
"https://wii.leseratte10.de/devkitPro/switch/switch-libpng-1.6.39-1-any.pkg.tar.xz" \
|
|
|
|
"https://wii.leseratte10.de/devkitPro/switch/switch-zlib-1.2.13-1-any.pkg.tar.xz" \
|
|
|
|
"https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.2-1-any.pkg.tar.xz" \
|
|
|
|
"https://wii.leseratte10.de/devkitPro/cmake/switch-cmake-1.5.0-1-any.pkg.tar.xz"
|
2023-03-20 15:58:00 +00:00
|
|
|
|
2023-03-20 16:48:21 +00:00
|
|
|
- name: Silence all git safe directory warnings
|
|
|
|
run: git config --global --add safe.directory '*'
|
2022-02-09 04:52:04 +00:00
|
|
|
|
2023-03-20 16:48:21 +00:00
|
|
|
# Workaround: manually use git instead of actions/checkout to parse repository properties (e.g. branch name, commit hash, etc.) on our own.
|
|
|
|
- name: Checkout latest nxdumptool-rewrite commit
|
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE"
|
|
|
|
git clone --branch rewrite --recurse-submodules https://github.com/DarkMatterCore/nxdumptool.git
|
2022-02-09 04:52:04 +00:00
|
|
|
|
2023-03-20 15:58:00 +00:00
|
|
|
- name: Checkout latest libnx commit
|
2023-03-20 16:48:21 +00:00
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE"
|
|
|
|
git clone --recurse-submodules https://github.com/switchbrew/libnx.git
|
2023-03-20 15:58:00 +00:00
|
|
|
|
|
|
|
- name: Set workspace permissions
|
|
|
|
run: chmod 777 -R "$GITHUB_WORKSPACE"
|
|
|
|
|
|
|
|
- name: Build and install libnx
|
2022-02-09 04:52:04 +00:00
|
|
|
run: |
|
2023-03-20 16:48:21 +00:00
|
|
|
cd "$GITHUB_WORKSPACE/libnx"
|
2023-03-25 11:10:07 +00:00
|
|
|
make install -j$(nproc)
|
2023-03-20 15:58:00 +00:00
|
|
|
|
|
|
|
- name: Build libusbhsfs dependencies
|
2022-02-09 04:52:04 +00:00
|
|
|
run: |
|
2023-03-20 16:48:21 +00:00
|
|
|
cd "$GITHUB_WORKSPACE/nxdumptool/libs/libusbhsfs"
|
2023-03-25 11:17:01 +00:00
|
|
|
su -s /bin/bash nobody -c "make fs-libs -j$(nproc)"
|
2022-02-09 04:52:04 +00:00
|
|
|
|
2023-03-24 23:39:34 +00:00
|
|
|
- name: Build nxdumptool-rewrite PoC binaries
|
2022-02-09 04:52:04 +00:00
|
|
|
run: |
|
2023-03-20 16:48:21 +00:00
|
|
|
cd "$GITHUB_WORKSPACE/nxdumptool"
|
2023-03-20 18:15:59 +00:00
|
|
|
echo "nxdt_commit=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
2022-02-09 04:52:04 +00:00
|
|
|
./build.sh
|
|
|
|
|
2023-03-24 23:39:34 +00:00
|
|
|
- name: Build nxdumptool-rewrite GUI binary
|
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/nxdumptool"
|
2023-03-25 11:10:07 +00:00
|
|
|
make -j$(nproc)
|
2023-03-24 23:39:34 +00:00
|
|
|
|
2023-03-20 15:58:00 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-02-09 04:52:04 +00:00
|
|
|
with:
|
2023-03-20 18:15:59 +00:00
|
|
|
name: nxdumptool-rewrite_poc_${{ env.nxdt_commit }}.7z
|
|
|
|
path: nxdumptool/nxdumptool-rewrite_poc_${{ env.nxdt_commit }}.7z
|
2022-02-09 04:52:04 +00:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2023-03-20 15:58:00 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-02-09 04:52:04 +00:00
|
|
|
with:
|
2023-03-20 18:15:59 +00:00
|
|
|
name: nxdumptool-rewrite_poc_${{ env.nxdt_commit }}-Debug_ELFs.7z
|
|
|
|
path: nxdumptool/nxdumptool-rewrite_poc_${{ env.nxdt_commit }}-Debug_ELFs.7z
|
2022-02-09 04:52:04 +00:00
|
|
|
if-no-files-found: error
|
2023-03-24 23:39:34 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: nxdumptool-rewrite-${{ env.nxdt_commit }}.nro
|
|
|
|
path: nxdumptool/nxdumptool.nro
|
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: nxdumptool-rewrite-${{ env.nxdt_commit }}.elf
|
|
|
|
path: nxdumptool/nxdumptool.elf
|
|
|
|
if-no-files-found: error
|