2023-07-21 23:53:56 +01:00
|
|
|
name: Build nxdumptool-rewrite binary
|
2022-02-09 04:52:04 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ rewrite ]
|
2024-04-15 13:30:48 +01:00
|
|
|
|
2023-04-09 14:39:42 +01:00
|
|
|
paths:
|
|
|
|
- '.github/workflows/rewrite.yml'
|
|
|
|
- 'code_templates/**'
|
|
|
|
- 'include/**'
|
|
|
|
- 'libs/**'
|
|
|
|
- 'romfs/**'
|
|
|
|
- 'source/**'
|
|
|
|
- 'build.sh'
|
|
|
|
- 'Makefile'
|
2022-02-09 04:52:04 +00:00
|
|
|
|
2023-03-20 15:58:00 +00:00
|
|
|
# Allows you to run this workflow manually from the Actions tab.
|
2022-02-09 04:52:04 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2024-04-15 13:30:48 +01:00
|
|
|
|
2022-02-09 04:52:04 +00:00
|
|
|
container:
|
|
|
|
image: devkitpro/devkita64
|
2024-04-15 13:30:48 +01:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-02-09 04:52:04 +00:00
|
|
|
steps:
|
2024-05-01 17:40:18 +01:00
|
|
|
- name: Set environment variables
|
2024-05-01 12:56:49 +01:00
|
|
|
run: |
|
2024-05-01 17:40:18 +01:00
|
|
|
echo "nxdt_commit=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
|
|
|
echo "need_node=$(command -v node >/dev/null 2>&1 && echo 0 || echo 1)" >> $GITHUB_ENV
|
2022-02-09 04:52:04 +00:00
|
|
|
|
2024-05-01 17:40:18 +01:00
|
|
|
# Taken from https://github.com/nektos/act/issues/973. Needed when running this workflow locally using Docker + act.
|
|
|
|
- name: Install node (ccache requirement)
|
|
|
|
if: ${{ env.need_node == '1' }}
|
2024-04-15 13:30:48 +01:00
|
|
|
run: |
|
2024-05-01 17:40:18 +01:00
|
|
|
curl -sS https://webi.sh/node | sh
|
|
|
|
echo ~/.local/opt/node/bin >> $GITHUB_PATH
|
2023-03-20 15:58:00 +00:00
|
|
|
|
2024-05-01 17:40:18 +01:00
|
|
|
- name: Clone nxdumptool repository
|
|
|
|
run: |
|
|
|
|
git clone --recurse-submodules https://github.com/DarkMatterCore/nxdumptool .
|
2024-04-15 13:43:00 +01:00
|
|
|
|
2024-04-15 13:30:48 +01:00
|
|
|
- name: Setup ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
2023-03-20 15:58:00 +00:00
|
|
|
|
2024-05-01 17:40:18 +01:00
|
|
|
- name: Set workspace permissions
|
|
|
|
run: chmod 777 -R "$GITHUB_WORKSPACE"
|
|
|
|
|
2024-04-15 13:30:48 +01:00
|
|
|
# ccache invocation is handled in the build script.
|
|
|
|
- name: Build nxdumptool-rewrite PoC binary
|
|
|
|
id: build
|
|
|
|
continue-on-error: true
|
2022-02-09 04:52:04 +00:00
|
|
|
run: |
|
2024-04-15 13:30:48 +01:00
|
|
|
./build.sh --noconfirm
|
2023-03-20 15:58:00 +00:00
|
|
|
|
2024-04-15 13:30:48 +01:00
|
|
|
- name: Install latest libnx commit and retry build
|
|
|
|
id: retry
|
|
|
|
if: ${{ steps.build.outcome == 'failure' }}
|
2022-02-09 04:52:04 +00:00
|
|
|
run: |
|
2024-04-15 13:30:48 +01:00
|
|
|
pushd /tmp
|
|
|
|
git clone https://github.com/switchbrew/libnx
|
|
|
|
cd libnx
|
|
|
|
make -j8 PREFIX="ccache aarch64-none-elf-"
|
|
|
|
make install
|
|
|
|
popd
|
2024-02-16 23:19:29 +00:00
|
|
|
./build.sh --noconfirm
|
2022-02-09 04:52:04 +00:00
|
|
|
|
2024-05-01 17:40:18 +01:00
|
|
|
- name: Build nxdumptool-rewrite GUI binary
|
|
|
|
run: |
|
|
|
|
make -j8 PREFIX="ccache aarch64-none-elf-"
|
2023-03-24 23:39:34 +00:00
|
|
|
|
2024-05-01 11:50:36 +01:00
|
|
|
- uses: actions/upload-artifact@v4
|
2022-02-09 04:52:04 +00:00
|
|
|
with:
|
2024-05-01 17:40:18 +01:00
|
|
|
name: nxdt_rw_poc-${{ env.nxdt_commit }}.nro
|
2024-04-15 13:30:48 +01:00
|
|
|
path: code_templates/tmp/nxdt_rw_poc.nro
|
2022-02-09 04:52:04 +00:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2024-05-01 11:50:36 +01:00
|
|
|
- uses: actions/upload-artifact@v4
|
2022-02-09 04:52:04 +00:00
|
|
|
with:
|
2024-05-01 17:40:18 +01:00
|
|
|
name: nxdt_rw_poc-${{ env.nxdt_commit }}.elf
|
2024-04-15 13:30:48 +01:00
|
|
|
path: code_templates/tmp/nxdt_rw_poc.elf
|
2022-02-09 04:52:04 +00:00
|
|
|
if-no-files-found: error
|
2023-03-24 23:39:34 +00:00
|
|
|
|
2024-05-01 17:40:18 +01:00
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.nro
|
|
|
|
path: nxdumptool.nro
|
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.elf
|
|
|
|
path: nxdumptool.elf
|
|
|
|
if-no-files-found: error
|
2023-10-17 07:20:32 +01:00
|
|
|
|
|
|
|
- name: Upload artifact to prerelease
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
2023-11-03 18:03:50 +00:00
|
|
|
# Only update attachments on "rewrite-prerelease" tag.
|
2023-10-17 07:20:32 +01:00
|
|
|
prerelease: True
|
|
|
|
tag: "rewrite-prerelease"
|
|
|
|
updateOnlyUnreleased: True
|
2023-11-03 01:22:47 +00:00
|
|
|
# Remove old artifacts and replace with new ones.
|
2023-10-17 07:20:32 +01:00
|
|
|
removeArtifacts: True
|
|
|
|
replacesArtifacts: True
|
2023-11-03 01:22:47 +00:00
|
|
|
# Update preferences.
|
2023-10-17 07:20:32 +01:00
|
|
|
allowUpdates: True
|
|
|
|
omitBody: True
|
|
|
|
omitBodyDuringUpdate: True
|
|
|
|
omitNameDuringUpdate: True
|
2024-04-15 13:30:48 +01:00
|
|
|
artifacts: "code_templates/tmp/nxdt_rw_poc.*"
|
|
|
|
#artifacts: "code_templates/tmp/nxdt_rw_poc.*, nxdumptool.*"
|
2023-10-17 07:20:32 +01:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|