From 1bfbed08b3edee71da459d68a5493624ed851dee Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Mon, 20 Mar 2023 16:58:00 +0100 Subject: [PATCH] Update libusbhsfs + workflow --- .github/workflows/rewrite.yml | 81 ++++++++++++++++++++++------------- libs/libusbhsfs | 2 +- 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/.github/workflows/rewrite.yml b/.github/workflows/rewrite.yml index 32f57d5..d91f1c9 100644 --- a/.github/workflows/rewrite.yml +++ b/.github/workflows/rewrite.yml @@ -1,57 +1,78 @@ -name: Build nxdumptool 'rewrite' tests +name: Build nxdumptool 'rewrite' PoC binaries on: push: branches: [ rewrite ] - # Allows you to run this workflow manually from the Actions tab + # Allows you to run this workflow manually from the Actions tab. workflow_dispatch: +env: + DEVKITPRO: "/opt/devkitpro" + DEVKITARM: "/opt/devkitpro/devkitARM" + DEVKITPPC: "/opt/devkitpro/devkitPPC" + jobs: build: runs-on: ubuntu-latest container: image: devkitpro/devkita64 steps: - - uses: actions/checkout@v2 + - 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 + sudo -n dkp-pacman -Syu --needed --noconfirm + + - name: Checkout latest nxdumptool-rewrite commit + uses: actions/checkout@v3 with: submodules: recursive - - name: Updating repos, install dkp-toolchain-vars, and set permissions... - run: | - sudo apt-get update ; sudo apt-get upgrade -y patch fakeroot p7zip-full - sudo -n dkp-pacman --noconfirm -U "https://web.archive.org/web/20220209041425if_/https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.0-2-any.pkg.tar.xz" - useradd nxdt-build - chmod 777 -R $GITHUB_WORKSPACE - - name: Export variables. - run: | - export COMMIT="$(git rev-parse --short HEAD)" ; echo commit="$(git rev-parse --short HEAD)" >> $GITHUB_ENV + # Workaround: manually use git instead of actions/checkout to overcome a 'missing token' error with act. + #- name: Checkout latest libnx commit + # run: | + # cd "$GITHUB_WORKSPACE/libs" + # git clone --recurse-submodules https://github.com/switchbrew/libnx.git - - name: Building libusbhsfs - liblwext4... - run: | - cd $GITHUB_WORKSPACE/libs/libusbhsfs/liblwext4 - sudo -u nxdt-build -n COMMIT="$(git rev-parse --short HEAD)" DEVKITPRO=/opt/devkitpro DEVKITARM=/opt/devkitpro/devkitARM DEVKITPPC=/opt/devkitpro/devkitPPC dkp-makepkg - sudo dkp-pacman -U switch-lwext4*.tar.xz --noconfirm + - name: Checkout latest libnx commit + uses: actions/checkout@v3 + with: + repository: switchbrew/libnx + submodules: recursive + path: libs/libnx - - name: Building libusbhsfs - libntfs-3g... - run: | - cd $GITHUB_WORKSPACE/libs/libusbhsfs/libntfs-3g - sudo -u nxdt-build -n COMMIT="$(git rev-parse --short HEAD)" DEVKITPRO=/opt/devkitpro DEVKITARM=/opt/devkitpro/devkitARM DEVKITPPC=/opt/devkitpro/devkitPPC dkp-makepkg - sudo dkp-pacman -U switch-libntfs-3g*.tar.xz --noconfirm + - name: Set workspace permissions + run: chmod 777 -R "$GITHUB_WORKSPACE" - - name: Building nxdumptool... + - name: Build and install libnx run: | - cd $GITHUB_WORKSPACE + cd "$GITHUB_WORKSPACE/libs/libnx" + sudo --preserve-env=DEVKITPRO,DEVKITARM,DEVKITPPC -n make install -j$(nproc) + + # Workaround for Docker image bug (see https://github.com/actions/checkout/issues/1169). + - name: "Workaround: add git safe directory (libusbhsfs)" + run: git config --system --add safe.directory "$GITHUB_WORKSPACE/libs/libusbhsfs" + + - name: Build libusbhsfs dependencies + run: | + cd "$GITHUB_WORKSPACE/libs/libusbhsfs" + sudo --preserve-env=DEVKITPRO,DEVKITARM,DEVKITPPC -n make fs-libs -j$(nproc) + + - name: Build nxdumptool + run: | + cd "$GITHUB_WORKSPACE" + export COMMIT=$(git rev-parse --short HEAD) ./build.sh - - uses: actions/upload-artifact@v2.3.1 + - uses: actions/upload-artifact@v3 with: - name: nxdumptool rewrite (NRO) - ${{ env.commit }}.7z - path: nxdumptool-rewrite_poc_${{ env.commit }}.7z + name: nxdumptool rewrite (NRO) - ${{ env.COMMIT }}.7z + path: nxdumptool-rewrite_poc_${{ env.COMMIT }}.7z if-no-files-found: error - - uses: actions/upload-artifact@v2.3.1 + - uses: actions/upload-artifact@v3 with: - name: nxdumptool rewrite - (Debug ELF) - ${{ env.commit }}.7z - path: nxdumptool-rewrite_poc_${{ env.commit }}-Debug_ELFs.7z + name: nxdumptool rewrite (Debug ELF) - ${{ env.COMMIT }}.7z + path: nxdumptool-rewrite_poc_${{ env.COMMIT }}-Debug_ELFs.7z if-no-files-found: error diff --git a/libs/libusbhsfs b/libs/libusbhsfs index 8c2e517..d6a4f38 160000 --- a/libs/libusbhsfs +++ b/libs/libusbhsfs @@ -1 +1 @@ -Subproject commit 8c2e51703d3e4f987b8857052b4da4bde12a6333 +Subproject commit d6a4f38784e1ddf5d1d8fa4805f7789050b60f93