Merge pull request #49 from thp/pr-builds #5
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
# With thanks to https://gist.github.com/weibeld/f136048d0a82aacc063f42e684e3c494 | |
name: build-and-release | |
on: | |
push: | |
branches: | |
- main | |
- set-up-cicd | |
permissions: | |
contents: write | |
jobs: | |
release-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
path: src | |
- name: Install DJGPP | |
run: | | |
wget -P /tmp https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2 | |
echo "8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00 /tmp/djgpp-linux64-gcc1220.tar.bz2" | shasum -a 256 --check | |
tar -xf /tmp/djgpp-linux64-gcc1220.tar.bz2 -C /opt | |
rm /tmp/djgpp-linux64-gcc1220.tar.bz2 | |
- name: Build project | |
run: | | |
cd $GITHUB_WORKSPACE/src | |
test -f main.c | |
. /opt/djgpp/setenv | |
make | |
test -f output/sbemu.exe | |
- name: Build FreeDOS SBEMU USB image | |
run: | | |
shellcheck $GITHUB_WORKSPACE/src/scripts/build-release-artifacts.sh | |
$GITHUB_WORKSPACE/src/scripts/build-release-artifacts.sh $GITHUB_WORKSPACE/src/output/sbemu.exe $GITHUB_WORKSPACE/ | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "release_tag=UserBuild_$(date +"%Y.%m.%d_%H-%M")" >> $GITHUB_OUTPUT | |
- name: Release FreeDOS SBEMU USB image | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: | | |
${{ github.workspace }}/SBEMU.zip | |
${{ github.workspace }}/SBEMU-FD13-USB.img.xz | |
body: | | |
## Available files | |
If you wish to use SBEMU and its dependencies in an existing DOS installation, you'll find the necessary | |
files in `SBEMU.zip`. | |
Alternatively, `SBEMU-FD13-USB.img.xz` provides SBEMU and is dependencies preconfigured inside a compressed | |
bootable FreeDOS image that you can write to a USB flash drive or an SD card. | |
<details> | |
<summary>Preparing a bootable USB drive</summary> | |
## Preparing a bootable USB drive | |
The USB image can be written to a USB drive or SD card using a tool like [balenaEtcher](https://etcher.balena.io/). | |
The advantage of using Etcher is that you don't have to decompress the `.xz` archive first. | |
It will decompress such files automatically, before writing the image to the target drive. | |
</details> | |
<details> | |
<summary>Booting the USB image in a virtual machine</summary> | |
## Booting the USB image in a virtual machine | |
You can run the image in a VM with QEMU as follows: | |
```shell | |
unxz SBEMU-FD13-USB.img.xz | |
qemu-system-i386 -drive file=SBEMU-FD13-USB.img,format=raw -device AC97 | |
``` | |
If you wish to test Intel HDA compatibility instead of ICHx AC'97 compatibility, replace `AC97` with `intel-hda` in the last command above. | |
On Linux, you can include the parameter `--enable-kvm` to run the VM with hardware-assisted virtualization. | |
If you prefer to use another hypervisor, such as VirtualBox or VMware, you may have to convert the raw image to a supported VM image format first: | |
```shell | |
unxz SBEMU-FD13-USB.img.xz | |
qemu-img convert -f raw -O vmdk SBEMU-FD13-USB.img SBEMU-FD13-USB.vmdk | |
``` | |
**NOTE**: Although VMs can sometimes be useful during development, testing and debugging, you should not rely on those for actual hardware compatibility testing, since the sound cards that the hypervisors emulate are themselves merely approximations of actual hardware, and will not behave like the real thing in every single corner case. | |
Basically, you shouldn't test emulators on other emulators. | |
</details> | |
<details> | |
<summary>Where can I get some DOS games to test with?</summary> | |
## Where can I get some DOS games to test with? | |
There are multiple convenient distributions out there that contain DOS games that can be distributed freely and legally. | |
Specifically freeware, shareware, open source and free demo versions. | |
Here are a few links to such distributions: | |
- [The PC/DOS Mini](http://vieju.net/pcdosmini/), a compilation of 100+ DOS games ready to play for free | |
- [GAFFA DOS Shareware/Freeware Pack](https://archive.org/details/gaffa-dos-shareware-pack) (please [donate to the Internet Archive](https://archive.org/donate/), by the way!️ ❤️) | |
</details> |