1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-26 12:12:02 +00:00

workflow: only build nxdt_rw_poc binary

This commit is contained in:
Pablo Curiel 2023-07-22 00:53:56 +02:00
parent 34615f19c3
commit 4882f8430a
3 changed files with 18 additions and 42 deletions

View file

@ -1,4 +1,4 @@
name: Build nxdumptool-rewrite binaries name: Build nxdumptool-rewrite binary
on: on:
push: push:
@ -70,7 +70,7 @@ jobs:
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 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 .. 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 ..
- name: Build nxdumptool-rewrite PoC binaries - name: Build nxdumptool-rewrite PoC binary
run: | run: |
cd "$GITHUB_WORKSPACE/nxdumptool" cd "$GITHUB_WORKSPACE/nxdumptool"
echo "nxdt_commit=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "nxdt_commit=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
@ -83,14 +83,14 @@ jobs:
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: nxdumptool-rewrite_poc_${{ env.nxdt_commit }}.7z name: nxdt_rw_poc-${{ env.nxdt_commit }}.nro
path: nxdumptool/nxdumptool-rewrite_poc_${{ env.nxdt_commit }}.7z path: nxdumptool/code_templates/tmp/nxdt_rw_poc.nro
if-no-files-found: error if-no-files-found: error
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: nxdumptool-rewrite_poc_${{ env.nxdt_commit }}-Debug_ELFs.7z name: nxdt_rw_poc-${{ env.nxdt_commit }}.elf
path: nxdumptool/nxdumptool-rewrite_poc_${{ env.nxdt_commit }}-Debug_ELFs.7z path: nxdumptool/code_templates/tmp/nxdt_rw_poc.elf
if-no-files-found: error if-no-files-found: error
#- uses: actions/upload-artifact@v3 #- uses: actions/upload-artifact@v3

2
.gitignore vendored
View file

@ -12,8 +12,6 @@ host/nxdumptool
*.map *.map
*.pfs0 *.pfs0
*.lst *.lst
*.tar.bz2
*.7z
*.log *.log
*.spec *.spec
*.exe *.exe

View file

@ -1,11 +1,7 @@
#!/bin/bash #!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" cd "$(dirname "${BASH_SOURCE[0]}")"
archive_filename="nxdumptool-rewrite_poc_$(git rev-parse --short HEAD)"
# Clean-up from last build # Clean-up from last build
rm -f ./*.7z
rm -rf ./code_templates/tmp rm -rf ./code_templates/tmp
mkdir ./code_templates/tmp mkdir ./code_templates/tmp
@ -13,43 +9,25 @@ mv ./source/main.cpp ./main.cpp
make clean_all make clean_all
# Build loop # Build PoC
for f in ./code_templates/*.c; do poc_name="nxdt_rw_poc"
basename="$(basename "$f")" poc_path="./code_templates/$poc_name.c"
filename="${basename%.*}"
if [[ $filename == "dump_title_infos" ]]; then rm -f ./source/main.c
continue cp $poc_path ./source/main.c
fi
echo $filename cp ./romfs/icon/nxdumptool.jpg ./romfs/icon/$poc_name.jpg
rm -f ./source/main.c make BUILD_TYPE="$poc_name" -j$(nproc)
cp $f ./source/main.c
cp ./romfs/icon/nxdumptool.jpg ./romfs/icon/$filename.jpg rm -f ./romfs/icon/$poc_name.jpg
make BUILD_TYPE="$filename" -j$(nproc) mv -f ./$poc_name.nro ./code_templates/tmp/$poc_name.nro
mv -f ./$poc_name.elf ./code_templates/tmp/$poc_name.elf
rm -f ./romfs/icon/$filename.jpg
mkdir ./code_templates/tmp/$filename
cp ./$filename.nro ./code_templates/tmp/$filename/$filename.nro
cp ./$filename.elf ./code_templates/tmp/$filename/$filename.elf
make BUILD_TYPE="$filename" clean
done
# Post build clean-up # Post build clean-up
make BUILD_TYPE="$poc_name" clean
make clean_all make clean_all
# Package resulting binaries
cd ./code_templates/tmp
7z a ../../"$archive_filename.7z" */*.nro
7z a ../../"$archive_filename-Debug_ELFs.7z" */*.elf
# Final clean-up
cd ../..
rm -f ./source/main.c rm -f ./source/main.c
rm -rf ./code_templates/tmp mv -f ./main.cpp ./source/main.cpp
mv ./main.cpp ./source/main.cpp