Skip to content

Commit ec6deed

Browse files
authored
Minor workflow simplifications (#144)
* Simplify workflow * Update libusbhsfs submodule
1 parent e6ffe64 commit ec6deed

2 files changed

Lines changed: 17 additions & 33 deletions

File tree

.github/workflows/rewrite.yml

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,66 +16,50 @@ on:
1616
# Allows you to run this workflow manually from the Actions tab.
1717
workflow_dispatch:
1818

19-
env:
20-
DEVKITPRO: "/opt/devkitpro"
21-
DEVKITARM: "/opt/devkitpro/devkitARM"
22-
DEVKITPPC: "/opt/devkitpro/devkitPPC"
23-
2419
jobs:
2520
build:
2621
runs-on: ubuntu-latest
27-
# Skip build with [ci skip] in commit
28-
if: "! contains(github.event.head_commit.message, '[ci skip]')"
2922
container:
3023
image: devkitpro/devkita64
3124
steps:
3225
# Workaround: avoid requesting data from devkitPro servers because they ban most CI/CD scripts.
26+
# TODO: Remove the last dkp-pacman invocation if https://github.com/devkitPro/docker/pull/28 gets accepted
3327
- name: Update packages
3428
run: |
3529
sudo -n apt-get update
3630
sudo -n apt-get upgrade -y patch autoconf automake tar bzip2 diffutils pkgconf fakeroot git file zstd
3731
sudo -n dkp-pacman --noconfirm -U \
38-
"https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.3-2-any.pkg.tar.zst" \
39-
"https://wii.leseratte10.de/devkitPro/cmake/switch-cmake-1.5.0-1-any.pkg.tar.xz"
40-
# "https://wii.leseratte10.de/devkitPro/switch/switch-libjson-c-0.16-1-any.pkg.tar.xz" \
41-
# "https://wii.leseratte10.de/devkitPro/switch/switch-libpng-1.6.39-2-any.pkg.tar.zst" \
42-
# "https://wii.leseratte10.de/devkitPro/switch/switch-zlib-1.2.13-1-any.pkg.tar.xz"
43-
44-
- name: Silence all git safe directory warnings
45-
run: git config --system --add safe.directory '*'
32+
"https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.3-2-any.pkg.tar.zst"
4633
47-
# Workaround: manually use git instead of actions/checkout to parse repository properties (e.g. branch name, commit hash, etc.) on our own.
48-
- name: Checkout latest nxdumptool-rewrite commit
49-
run: |
50-
cd "$GITHUB_WORKSPACE"
51-
git clone --branch rewrite --recurse-submodules https://github.com/DarkMatterCore/nxdumptool.git
34+
- uses: actions/checkout@v4
35+
with:
36+
path: nxdumptool
37+
submodules: recursive
5238

5339
- name: Checkout latest libnx commit
54-
run: |
55-
cd "$GITHUB_WORKSPACE"
56-
git clone --recurse-submodules https://github.com/switchbrew/libnx.git
40+
uses: actions/checkout@v4
41+
with:
42+
repository: switchbrew/libnx
43+
path: libnx
44+
submodules: recursive
5745

5846
- name: Set workspace permissions
5947
run: chmod 777 -R "$GITHUB_WORKSPACE"
6048

6149
- name: Build and install libnx
50+
working-directory: libnx
6251
run: |
63-
cd "$GITHUB_WORKSPACE/libnx"
6452
make install -j$(nproc)
6553
66-
# 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.
67-
# We can't just provide root access to dkp-makepkg because it refuses to work at all if we do so.
68-
# As much as I'd like to run "make fs-libs" and call it a day, it's just not possible.
6954
- name: Build libusbhsfs dependencies
55+
working-directory: nxdumptool/libs/libusbhsfs
7056
run: |
71-
cd "$GITHUB_WORKSPACE/nxdumptool/libs/libusbhsfs"
72-
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 ..
73-
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 ..
57+
make fs-libs
7458
7559
- name: Build nxdumptool-rewrite PoC binary
60+
working-directory: nxdumptool
7661
run: |
77-
cd "$GITHUB_WORKSPACE/nxdumptool"
78-
echo "nxdt_commit=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
62+
echo "nxdt_commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
7963
./build.sh
8064
8165
#- name: Build nxdumptool-rewrite GUI binary

libs/libusbhsfs

0 commit comments

Comments
 (0)