1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-29 21:52:22 +00:00
nxdumptool/.github/workflows/rewrite.yml

107 lines
4.2 KiB
YAML
Raw Normal View History

2023-03-24 23:39:34 +00:00
name: Build nxdumptool-rewrite binaries
on:
push:
branches: [ rewrite ]
paths:
- '.github/workflows/rewrite.yml'
- 'code_templates/**'
- 'include/**'
- 'libs/**'
- 'romfs/**'
- 'source/**'
- 'build.sh'
- 'Makefile'
2023-03-20 15:58:00 +00:00
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
2023-03-20 15:58:00 +00:00
env:
DEVKITPRO: "/opt/devkitpro"
DEVKITARM: "/opt/devkitpro/devkitARM"
DEVKITPPC: "/opt/devkitpro/devkitPPC"
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
2023-05-24 20:16:20 +01:00
sudo -n apt-get upgrade -y patch autoconf automake tar bzip2 diffutils pkgconf fakeroot p7zip-full git file zstd
2023-05-24 20:12:01 +01:00
sudo -n dkp-pacman --noconfirm -U \
"https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.3-2-any.pkg.tar.zst" \
"https://wii.leseratte10.de/devkitPro/cmake/switch-cmake-1.5.0-1-any.pkg.tar.xz"
# "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-2-any.pkg.tar.zst" \
# "https://wii.leseratte10.de/devkitPro/switch/switch-zlib-1.2.13-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
2023-03-25 11:54:18 +00:00
run: git config --system --add safe.directory '*'
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
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
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
2023-03-25 11:54:18 +00:00
# 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.
# We can't just provide root access to dkp-makepkg because it refuses to work at all if we do so.
# As much as I'd like to run "make fs-libs" and call it a day, it's just not possible.
2023-03-20 15:58:00 +00:00
- name: Build libusbhsfs dependencies
run: |
2023-03-20 16:48:21 +00:00
cd "$GITHUB_WORKSPACE/nxdumptool/libs/libusbhsfs"
2023-03-25 11:54:18 +00:00
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 ..
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 ..
2023-03-24 23:39:34 +00:00
- name: Build nxdumptool-rewrite PoC binaries
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
./build.sh
I'm a terrible person and an even worse developer. And I don't need anyone to tell me so, thank you very much. * PoC: remove gc_dumper and nsp_dumper PoC; create nxdt_rw_poc with all gc_dumper and nsp_dumper capabilities + standalone ticket dumping + raw NCA dumping; use ftruncate() to set output file sizes whenever possible. PoC code is a mess, as always. Expect the features from the rest of the PoCs to be implemented into nxdt_rw_poc soon. * workflow: temporarily disable borealis build generation; comment out manual installation of up-to-date packages from Leseratte's mirrors because the latest devkitA64 Docker image has them all. * borealis: update to fix building issues with latest devkitA64. * bfttf: error out on invalid NCA signatures. * config: save configuration to the current working directory; parse and validate new "gamecard/write_raw_hfs_partition" flag. * defines: remove CONFIG_PATH macro; rename CONFIG_FILE_NAME. * gamecard: rename fs_ctx -> hfs_ctx everywhere; use HFS function calls to retrieve partition names. * hfs: move GameCardHashFileSystemPartitionType enum from gamecard.h and rename it to HashFileSystemPartitionType; add hfsIsValidContext(); add hfsGetPartitionNameString(). * nca/npdm: update comments to reflect latest HOS version. * nxdt_bfsar: always generate absolute SD card paths with the device name; error out on an invalid NCA signature. * nxdt_includes: include dirent.h; refactor Version struct to make it a union of all known *Version structs. * nxdt_log: don't write session separator if the logfile is empty. * nxdt_utils: log appletIsGamePlayRecordingSupported() errors; add utilsDeleteDirectoryRecursively(). * rsa: provide clearer function descriptions in header file. * services: handle usb:ds initialization. * tik: update tikConvertPersonalizedTicketToCommonTicket() to allow NULL input pointers as raw certificate chain arguments (much needed for standalone ticket dumping). * title: add titleGetApplicationIdByMetaKey(). * usb: refactor interface (de)initialization code; slightly improve ABI usage (console-side only); redefine ABI version field in StartSession command blocks; upgrade ABI to v1.1. * FatFs: rename DIR -> FDIR to avoid conflicts with definitions from stdlib's dirent.h. * gamecard_tab: display package ID from the inserted gamecard; fix displayed version numbers from bundled system updates below 3.0.0. * todo: add notes about creating devoptab devices for HFS/PFS/RomFS file tree dumping.
2023-05-24 20:05:34 +01:00
#- name: Build nxdumptool-rewrite GUI binary
# run: |
# cd "$GITHUB_WORKSPACE/nxdumptool"
# make -j$(nproc)
2023-03-24 23:39:34 +00:00
2023-03-20 15:58:00 +00:00
- uses: actions/upload-artifact@v3
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
if-no-files-found: error
2023-03-20 15:58:00 +00:00
- uses: actions/upload-artifact@v3
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
if-no-files-found: error
2023-03-24 23:39:34 +00:00
I'm a terrible person and an even worse developer. And I don't need anyone to tell me so, thank you very much. * PoC: remove gc_dumper and nsp_dumper PoC; create nxdt_rw_poc with all gc_dumper and nsp_dumper capabilities + standalone ticket dumping + raw NCA dumping; use ftruncate() to set output file sizes whenever possible. PoC code is a mess, as always. Expect the features from the rest of the PoCs to be implemented into nxdt_rw_poc soon. * workflow: temporarily disable borealis build generation; comment out manual installation of up-to-date packages from Leseratte's mirrors because the latest devkitA64 Docker image has them all. * borealis: update to fix building issues with latest devkitA64. * bfttf: error out on invalid NCA signatures. * config: save configuration to the current working directory; parse and validate new "gamecard/write_raw_hfs_partition" flag. * defines: remove CONFIG_PATH macro; rename CONFIG_FILE_NAME. * gamecard: rename fs_ctx -> hfs_ctx everywhere; use HFS function calls to retrieve partition names. * hfs: move GameCardHashFileSystemPartitionType enum from gamecard.h and rename it to HashFileSystemPartitionType; add hfsIsValidContext(); add hfsGetPartitionNameString(). * nca/npdm: update comments to reflect latest HOS version. * nxdt_bfsar: always generate absolute SD card paths with the device name; error out on an invalid NCA signature. * nxdt_includes: include dirent.h; refactor Version struct to make it a union of all known *Version structs. * nxdt_log: don't write session separator if the logfile is empty. * nxdt_utils: log appletIsGamePlayRecordingSupported() errors; add utilsDeleteDirectoryRecursively(). * rsa: provide clearer function descriptions in header file. * services: handle usb:ds initialization. * tik: update tikConvertPersonalizedTicketToCommonTicket() to allow NULL input pointers as raw certificate chain arguments (much needed for standalone ticket dumping). * title: add titleGetApplicationIdByMetaKey(). * usb: refactor interface (de)initialization code; slightly improve ABI usage (console-side only); redefine ABI version field in StartSession command blocks; upgrade ABI to v1.1. * FatFs: rename DIR -> FDIR to avoid conflicts with definitions from stdlib's dirent.h. * gamecard_tab: display package ID from the inserted gamecard; fix displayed version numbers from bundled system updates below 3.0.0. * todo: add notes about creating devoptab devices for HFS/PFS/RomFS file tree dumping.
2023-05-24 20:05:34 +01:00
#- uses: actions/upload-artifact@v3
# with:
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.nro
# path: nxdumptool/nxdumptool.nro
# if-no-files-found: error
#- uses: actions/upload-artifact@v3
# with:
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.elf
# path: nxdumptool/nxdumptool.elf
# if-no-files-found: error