Skip to content

Commit

Permalink
Add CI and release pipeline (#1)
Browse files Browse the repository at this point in the history
* add ci script for running build

* test earlier steps

* Adjust shebang

* rename output to img

* add package

* add permission

* touch up readme
  • Loading branch information
metavee authored Jul 30, 2024
1 parent c976918 commit 2b773bb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Package

on: [push]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install just
uses: extractions/setup-just@v1
with:
just-version: 1.32.0

- name: Install NASM
uses: ilammy/setup-nasm@v1

- name: Build project
run: just build

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
puzdug.com
puzdug-boot.img
7 changes: 4 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ listing_out := infile_no_ext + ".lst"
bootloader_in := "bootloader.asm"
bootloader_out := "bootloader.bin"

boot_out := infile_no_ext + "-boot.bin"
boot_out := infile_no_ext + "-boot.img"

# # Size of 360 KB floppy in bytes
TARGET_SIZE := "368640"
Expand All @@ -34,8 +34,9 @@ build-stage2:
nasm -f bin -D BOOT -o {{stage2_out}} {{infile}} -l {{listing_out}}

padded-bootable: unpadded-bootable
#!/bin/bash -euo pipefail

#!/bin/bash
set -euo pipefail

target_size={{ TARGET_SIZE }}
# Get the current size of the image file
current_size=$(wc -c < {{boot_out}})
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ puzdug x86 is a tiny game written in 16-bit real-mode x86 assembly.
It is written such that it can be booted from a floppy on a BIOS-based computer.
Although it does not fit entirely in the boot sector, it comes with a bootloader that will load the game from a known location on disk and boot into that.

## Setup
## Downloads

Tagged commits are accompanied with a Github Release with the DOS-compatible `puzdug.com` and the bootable floppy image `puzdug-boot.img` attached.

## Developer Setup

Install the following tools:

Expand All @@ -23,13 +27,13 @@ And optionally:

## Running in DOSBox

Build with `just build-dos`.
Build with `just build-dos` or download the pre-built binary from the Releases page.

Open up DOSBox, mount the repo folder in (you may wish to set up a startup script), and run `PUZDUG.COM` or just `PUZDUG`.

## Running in qemu
## Running in qemu or a virtual machine

Build and run with `just qemu`. This creates the floppy image `puzdug-boot.bin`.
Build and run with `just qemu`. This creates the floppy image `puzdug-boot.bin`. You can also download the pre-built image from the Releases page.

Note that when the game exits, it enters an infinite loop and you need to kill qemu to fully stop it.

Expand Down

0 comments on commit 2b773bb

Please sign in to comment.