1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-09 20:21:45 +00:00
nxdumptool/.github/workflows/rewrite.yml
2023-03-20 16:58:00 +01:00

78 lines
2.5 KiB
YAML

name: Build nxdumptool 'rewrite' PoC binaries
on:
push:
branches: [ rewrite ]
# 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:
- 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
# 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: Checkout latest libnx commit
uses: actions/checkout@v3
with:
repository: switchbrew/libnx
submodules: recursive
path: libs/libnx
- name: Set workspace permissions
run: chmod 777 -R "$GITHUB_WORKSPACE"
- name: Build and install libnx
run: |
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@v3
with:
name: nxdumptool rewrite (NRO) - ${{ env.COMMIT }}.7z
path: nxdumptool-rewrite_poc_${{ env.COMMIT }}.7z
if-no-files-found: error
- uses: actions/upload-artifact@v3
with:
name: nxdumptool rewrite (Debug ELF) - ${{ env.COMMIT }}.7z
path: nxdumptool-rewrite_poc_${{ env.COMMIT }}-Debug_ELFs.7z
if-no-files-found: error