Skip to content

Commit

Permalink
Merge pull request #3 from lifehackerhansol/github-actions
Browse files Browse the repository at this point in the history
Makefile, build instructions, and GitHub Actions
  • Loading branch information
lilyuwuu authored Mar 14, 2024
2 parents fde2b80 + 5077986 commit d779515
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container: devkitpro/devkitarm

steps:
- name: Checkout finalize_helper
uses: actions/checkout@v4

- name: Checkout GodMode9
uses: actions/checkout@v4
with:
repository: d0k3/GodMode9
path: GodMode9
ref: v2.1.1

- name: Install packages
run: |
apt-get update
apt-get -y install dirmngr python3 python3-pip p7zip-full libarchive13
python3 -m pip install setuptools cryptography git+https://github.com/TuxSH/firmtool.git
- name: Install 3dstool
run: |
wget https://github.com/dnasdw/3dstool/releases/download/v1.2.6/3dstool_linux_x86_64.tar.gz
tar xvzf 3dstool_linux_x86_64.tar.gz
sudo cp 3dstool ext_key.txt ignore_3dstool.txt /usr/local/bin
sudo chmod a+x /usr/local/bin/3dstool
- name: Build Project
run: |
make
- uses: actions/upload-artifact@v4
with:
name: finalize_helper
path: builds
if-no-files-found: error
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "GodMode9"]
path = GodMode9
url = https://github.com/d0k3/GodMode9
1 change: 1 addition & 0 deletions GodMode9
Submodule GodMode9 added at f611b3
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY := builds finalize.romfs finalize_helper.firm clean

all: builds/finalize_helper.firm

builds:
@[ -d builds ] || mkdir -p builds

builds/finalize.romfs: builds
@3dstool -c -t romfs --romfs-dir romfs --file $@

builds/finalize_helper.firm: builds/finalize.romfs
@cp finalize_helper.gm9 GodMode9/data/autorun.gm9
@sed -i s/FINALIZE_SHA256SUM/$(shell sha256sum $< | awk '{print $$1}')/g GodMode9/data/autorun.gm9
@$(MAKE) -C GodMode9 SCRIPT_RUNNER=1
@cp GodMode9/output/GodMode9.firm $@

clean:
@rm -rf builds
@$(MAKE) -C GodMode9 clean
@rm GodMode9/data/autorun.gm9
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ Releases are tagged for reference (based on usage in the guide). **Releases in t

`finalize_helper` is not necessary unless you intend to use the RomFS build.


## Building

You need the following tools installed on your computer:
- [3dstool](https://github.com/dnasdw/3dstool/releases/latest)
- [devkitARM](https://devkitpro.org/wiki/Getting_Started)
- devkitARM is only required if you are building the FIRM, which you are going to want to anyway
- Install the 3DS related packages

Clone the repository via the following commands:
```
git clone https://github.com/hacks-guide/finalize --recurse-submodules
cd finalize
```

And build:
```
make
```

The romfs and FIRM will be present in the `builds` directory.

## License

TBD
2 changes: 1 addition & 1 deletion finalize_helper.gm9
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if not find 0:/finalize.romfs NULL
poweroff
end

if not sha 0:/finalize.romfs 73F93573C74A7A9F6443C52AD6D4AD701485B55B48B008D3A3DBD1B2F651A999
if not sha 0:/finalize.romfs FINALIZE_SHA256SUM
set PREVIEW_MODE "Finalizing Setup Helper Script\n> Copying SD files... :("
echo "Error #22: finalize.romfs is invalid\n \nThe file finalize.romfs is corrupt or unreadable.\nRe-download it, copy it to root of SD, and try again."
poweroff
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit d779515

Please sign in to comment.