mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-22 18:26:39 +00:00
Workflow improvements.
Based on the suggestions mentioned by @TSRBerry in #144. Speeds up compilation time by using ccache + fallbacks to the latest libnx commit if the build process fails with the libnx build available in the devkitPro image.
This commit is contained in:
parent
27465434d4
commit
bfe301ad25
3 changed files with 43 additions and 29 deletions
64
.github/workflows/rewrite.yml
vendored
64
.github/workflows/rewrite.yml
vendored
|
@ -3,6 +3,7 @@ name: Build nxdumptool-rewrite binary
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ rewrite ]
|
branches: [ rewrite ]
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/rewrite.yml'
|
- '.github/workflows/rewrite.yml'
|
||||||
- 'code_templates/**'
|
- 'code_templates/**'
|
||||||
|
@ -19,62 +20,71 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: devkitpro/devkita64
|
image: devkitpro/devkita64
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: nxdumptool
|
submodules: true
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Checkout latest libnx commit
|
- name: Set environment variables
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: switchbrew/libnx
|
|
||||||
path: libnx
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Set workspace permissions
|
|
||||||
run: chmod 777 -R "$GITHUB_WORKSPACE"
|
|
||||||
|
|
||||||
- name: Build and install libnx
|
|
||||||
working-directory: libnx
|
|
||||||
run: |
|
|
||||||
make install -j$(nproc)
|
|
||||||
|
|
||||||
- name: Build nxdumptool-rewrite PoC binary
|
|
||||||
working-directory: nxdumptool
|
|
||||||
run: |
|
run: |
|
||||||
echo "nxdt_commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
|
echo "nxdt_commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
|
||||||
|
# ccache invocation is handled in the build script.
|
||||||
|
- name: Build nxdumptool-rewrite PoC binary
|
||||||
|
id: build
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
./build.sh --noconfirm
|
||||||
|
|
||||||
|
- name: Install latest libnx commit and retry build
|
||||||
|
id: retry
|
||||||
|
if: ${{ steps.build.outcome == 'failure' }}
|
||||||
|
run: |
|
||||||
|
pushd /tmp
|
||||||
|
git clone https://github.com/switchbrew/libnx
|
||||||
|
cd libnx
|
||||||
|
make -j8 PREFIX="ccache aarch64-none-elf-"
|
||||||
|
make install
|
||||||
|
popd
|
||||||
./build.sh --noconfirm
|
./build.sh --noconfirm
|
||||||
|
|
||||||
#- name: Build nxdumptool-rewrite GUI binary
|
#- name: Build nxdumptool-rewrite GUI binary
|
||||||
# working-directory: nxdumptool
|
|
||||||
# run: |
|
# run: |
|
||||||
# make -j$(nproc)
|
# make -j8 PREFIX="ccache aarch64-none-elf-"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: nxdt_rw_poc-${{ env.nxdt_commit }}.nro
|
name: nxdt_rw_poc-${{ env.nxdt_commit }}.nro
|
||||||
path: nxdumptool/code_templates/tmp/nxdt_rw_poc.nro
|
path: 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: nxdt_rw_poc-${{ env.nxdt_commit }}.elf
|
name: nxdt_rw_poc-${{ env.nxdt_commit }}.elf
|
||||||
path: nxdumptool/code_templates/tmp/nxdt_rw_poc.elf
|
path: 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
|
||||||
# with:
|
# with:
|
||||||
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.nro
|
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.nro
|
||||||
# path: nxdumptool/nxdumptool.nro
|
# path: nxdumptool.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-${{ env.nxdt_commit }}-WIP_UI.elf
|
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.elf
|
||||||
# path: nxdumptool/nxdumptool.elf
|
# path: nxdumptool.elf
|
||||||
# if-no-files-found: error
|
# if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload artifact to prerelease
|
- name: Upload artifact to prerelease
|
||||||
|
@ -92,6 +102,6 @@ jobs:
|
||||||
omitBody: True
|
omitBody: True
|
||||||
omitBodyDuringUpdate: True
|
omitBodyDuringUpdate: True
|
||||||
omitNameDuringUpdate: True
|
omitNameDuringUpdate: True
|
||||||
artifacts: "nxdumptool/code_templates/tmp/nxdt_rw_poc.*"
|
artifacts: "code_templates/tmp/nxdt_rw_poc.*"
|
||||||
#artifacts: "nxdumptool/code_templates/tmp/nxdt_rw_poc.*, nxdumptool/nxdumptool.*"
|
#artifacts: "code_templates/tmp/nxdt_rw_poc.*, nxdumptool.*"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
6
build.sh
6
build.sh
|
@ -20,7 +20,11 @@ cp $poc_path ./source/main.c
|
||||||
|
|
||||||
cp ./romfs/icon/nxdumptool.jpg ./romfs/icon/$poc_name.jpg
|
cp ./romfs/icon/nxdumptool.jpg ./romfs/icon/$poc_name.jpg
|
||||||
|
|
||||||
make BUILD_TYPE="$poc_name" -j$(nproc)
|
if [ ${ARG,,} != "--noconfirm" ]; then
|
||||||
|
make BUILD_TYPE="$poc_name" -j$(nproc)
|
||||||
|
else
|
||||||
|
make BUILD_TYPE="$poc_name" -j8 PREFIX="ccache aarch64-none-elf-"
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f ./romfs/icon/$poc_name.jpg
|
rm -f ./romfs/icon/$poc_name.jpg
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"filename": {
|
"filename": {
|
||||||
"label": "Filename",
|
"label": "Filename",
|
||||||
"description": "Filename used for the output dump.\nIllegal filesystem characters will be automatically replaced with underscores (\"_\"). If the inserted SD card is used as the output storage, only ASCII characters will be kept — this is a limitation on Nintendo's FS driver.\nThe file extension cannot be modified, and it is excluded on purpose."
|
"description": "Filename used for the output dump.\nIllegal filesystem characters will be automatically replaced with underscores (\"_\"). If the inserted SD card is used as the output storage, only ASCII characters will be kept — this is a limitation of Nintendo's FS driver.\nThe file extension cannot be modified, and it is excluded on purpose."
|
||||||
},
|
},
|
||||||
|
|
||||||
"output_storage": {
|
"output_storage": {
|
||||||
|
|
Loading…
Reference in a new issue