Skip to content

Commit

Permalink
meta: add distrib script and Gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboard-slayer committed Aug 26, 2024
1 parent 5638ec1 commit 98a3716
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Nightly Build
on: [push]

jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'

- name: Install dependencies
run: |
sudo apt-get update -y && \
sudo apt-get install -y install build-essential git ninja-build nasm gcc-multilib
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm 18
- name: Build
run: |
./build.sh dist
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bootx64.efi
path: .cutekit/dist/bootx64.efi
if-no-files-found: error
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.cutekit
.cutekit/
__pycache__/
.DS_Store
17 changes: 17 additions & 0 deletions meta/plugins/dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pathlib import Path
from cutekit import cli, model, builder, shell, const


@cli.command("d", "dist", "Make booboot easier to distribute")
def _(args: model.TargetArgs):
registry = model.Registry.use(args)
component = registry.lookup("booboot", model.Component)
dist = Path(const.PROJECT_CK_DIR) / "dist"
dist.mkdir(parents=True, exist_ok=True)

for target in registry.iter(model.Target):
scope = builder.TargetScope(registry, target)
shell.cp(
builder.build(scope, component)[0].path,
str(dist / target.props["filename"]),
)
5 changes: 3 additions & 2 deletions meta/targets/efi-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"sys": "efi",
"abi": "ms",
"freestanding": false,
"host": false
"host": false,
"filename": "bootx64.efi"
},
"tools": {
"cc": {
Expand Down Expand Up @@ -63,4 +64,4 @@
]
}
}
}
}

0 comments on commit 98a3716

Please sign in to comment.