This commit is contained in:
Dagen Brock 2021-03-23 11:15:05 -05:00
parent d540a8ea3c
commit f2e192eaff
2 changed files with 124 additions and 0 deletions

64
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,64 @@
on: [push]
jobs:
cicd_pipeline:
runs-on: ubuntu-latest
name: Run assembly and disk image CICD pipeline
steps:
# CHECKOUT AND ASSEMBLE ON EVERY PUSH, ANY BRANCH
- uses: actions/checkout@v1
- name: Install Merlin
uses: digarok/install-merlin32-action@v0.1.0
- name: Assemble Source
run: |
merlin32 -V src/mmt.s
- name: Install Cadius
uses: digarok/install-cadius-action@v0.1.0
- name: Make Bootable ProDOS Image
if: startsWith(github.ref, 'refs/tags/v')
run: ./make_po.sh
# EVERYTHING BELOW IS ONLY WHEN VERSION TAGS PUSHED (i.e. tag like "v0.1")
- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Upload Release Asset - 140KB ProDOS Image
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./MMT140.po
asset_name: MMT140.po
asset_content_type: application/octet-stream
- name: Upload Release Asset - 800KB ProDOS Image (.po)
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./MMT800.po
asset_name: MMT800.po
asset_content_type: application/octet-stream
- name: Upload Release Asset - 800KB ProDOS Image (.2mg)
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./MMT800.2mg
asset_name: MMT800.2mg
asset_content_type: application/octet-stream

60
make_po.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/bash
command -v cadius >/dev/null 2>&1 || { echo "I require CADIUS but it's not installed. Aborting." >&2; exit 1; }
SRCFILES=(`ls src/*.s`)
SYSFILES=(`ls PRODOS.2.4.2//PRODOS src/*system`)
SRCDIR=src
BLDDIR=build/
DISK="MMT"
CADIUS="cadius"
if [ ! -d $BLDDIR ] ; then
echo "Build directory for this platform doesn't exist so I will create it."
mkdir -p $BLDDIR ; echo "Created: $BLDDIR"
fi
# need to autogen
cp src/_FileInformation.txt $BLDDIR
echo "Creating disk images"
$CADIUS createvolume ${DISK}800.2mg ${DISK}800 800KB >/dev/null
$CADIUS createvolume ${DISK}800.po ${DISK}800 800KB >/dev/null
$CADIUS createvolume ${DISK}140.po ${DISK}140 140KB >/dev/null
#SYSTEM FILES
echo -n "Processing System files: "
COMMA=""
for f in ${SYSFILES[@]};
do
FNAME=${f##*/}
echo -n "$COMMA $FNAME"
cp $f $BLDDIR/$FNAME
$CADIUS addfile ${DISK}800.2mg /${DISK}800/ $BLDDIR/$FNAME >/dev/null
$CADIUS addfile ${DISK}800.po /${DISK}800/ $BLDDIR/$FNAME >/dev/null
$CADIUS addfile ${DISK}140.po /${DISK}140/ $BLDDIR/$FNAME >/dev/null
COMMA=","
done
#SOURCE FILES
echo ""
echo -n "Processing Source files: "
COMMA=""
for f in ${SRCFILES[@]};
do
FNAME=${f##*/}
echo -n "$COMMA $FNAME"
cp $f $BLDDIR/$FNAME
echo "$FNAME=Type(04),AuxType(0000),VersionCreate(24),MinVersion(00),Access(E3)" > $BLDDIR/_FileInformation.txt
$CADIUS sethighbit $BLDDIR/$FNAME >/dev/null
$CADIUS addfile ${DISK}800.2mg /${DISK}800/ $BLDDIR/$FNAME >/dev/null
$CADIUS addfile ${DISK}800.po /${DISK}800/ $BLDDIR/$FNAME >/dev/null
$CADIUS addfile ${DISK}140.po /${DISK}140/ $BLDDIR/$FNAME >/dev/null
COMMA=","
done
echo "Look, I'm no expert, but I think everything went pretty well. (BUILD SUCCEEDED!!!)"
echo ""
exit