-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
2746543
commit bfe301a
Showing
3 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name: Build nxdumptool-rewrite binary | |
on: | ||
push: | ||
branches: [ rewrite ] | ||
|
||
paths: | ||
- '.github/workflows/rewrite.yml' | ||
- 'code_templates/**' | ||
|
@@ -19,62 +20,71 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: devkitpro/devkita64 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: nxdumptool | ||
submodules: recursive | ||
submodules: true | ||
|
||
- name: Checkout latest libnx commit | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: switchbrew/libnx | ||
path: libnx | ||
submodules: recursive | ||
- name: Set environment variables | ||
run: | | ||
echo "nxdt_commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV | ||
- name: Set workspace permissions | ||
run: chmod 777 -R "$GITHUB_WORKSPACE" | ||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
|
||
- name: Build and install libnx | ||
working-directory: libnx | ||
# ccache invocation is handled in the build script. | ||
- name: Build nxdumptool-rewrite PoC binary | ||
id: build | ||
continue-on-error: true | ||
run: | | ||
make install -j$(nproc) | ||
./build.sh --noconfirm | ||
- name: Build nxdumptool-rewrite PoC binary | ||
working-directory: nxdumptool | ||
- name: Install latest libnx commit and retry build | ||
id: retry | ||
if: ${{ steps.build.outcome == 'failure' }} | ||
run: | | ||
echo "nxdt_commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV | ||
pushd /tmp | ||
git clone https://github.com/switchbrew/libnx | ||
cd libnx | ||
make -j8 PREFIX="ccache aarch64-none-elf-" | ||
make install | ||
popd | ||
./build.sh --noconfirm | ||
#- name: Build nxdumptool-rewrite GUI binary | ||
# working-directory: nxdumptool | ||
# run: | | ||
# make -j$(nproc) | ||
# make -j8 PREFIX="ccache aarch64-none-elf-" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
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 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
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 | ||
|
||
#- uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.nro | ||
# path: nxdumptool/nxdumptool.nro | ||
# path: nxdumptool.nro | ||
# if-no-files-found: error | ||
|
||
#- uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: nxdumptool-rewrite-${{ env.nxdt_commit }}-WIP_UI.elf | ||
# path: nxdumptool/nxdumptool.elf | ||
# path: nxdumptool.elf | ||
# if-no-files-found: error | ||
|
||
- name: Upload artifact to prerelease | ||
|
@@ -92,6 +102,6 @@ jobs: | |
omitBody: True | ||
omitBodyDuringUpdate: True | ||
omitNameDuringUpdate: True | ||
artifacts: "nxdumptool/code_templates/tmp/nxdt_rw_poc.*" | ||
#artifacts: "nxdumptool/code_templates/tmp/nxdt_rw_poc.*, nxdumptool/nxdumptool.*" | ||
artifacts: "code_templates/tmp/nxdt_rw_poc.*" | ||
#artifacts: "code_templates/tmp/nxdt_rw_poc.*, nxdumptool.*" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters