mirror of
https://github.com/digarok/apple2-assembly-github-actions-ci-example.git
synced 2024-11-22 13:32:37 +00:00
CICD Example with CADIUS and Merlin32 Github Actions
This commit is contained in:
commit
87b36414d9
47
.github/workflows/main.yml
vendored
Normal file
47
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cicd_pipeline:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Run assembly and disk image CICD pipeline
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Install Merlin
|
||||||
|
uses: digarok/install-merlin32-action@v0.1.0
|
||||||
|
|
||||||
|
- name: Assemble Source
|
||||||
|
run: merlin32 src/example.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: |
|
||||||
|
cadius createvolume exampledsk.po exampledsk 140KB
|
||||||
|
cadius addfile exampledsk.po /exampledsk/ ./PRODOS.2.4.2/PRODOS
|
||||||
|
echo "example.system=Type(FF),AuxType(2000),VersionCreate(24),MinVersion(00),Access(21)" > ./src/_FileInformation.txt
|
||||||
|
cadius addfile exampledsk.po /exampledsk/ ./src/example.system
|
||||||
|
cadius catalog exampledsk.po
|
||||||
|
ls -al
|
||||||
|
|
||||||
|
- 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
|
||||||
|
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: ./exampledsk.po
|
||||||
|
asset_name: exampledsk.po
|
||||||
|
asset_content_type: application/octet-stream
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 Dagen Brock
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
33
README.md
Normal file
33
README.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# apple2-assembly-github-actions-ci-example
|
||||||
|
Example project to show CI with Github Actions to assemble 65xx source
|
||||||
|
|
||||||
|
# Explanation
|
||||||
|
See the projects `.github/workflows/main.yml` file to understand how it is automatically built using a Github action.
|
||||||
|
|
||||||
|
Uses: digarok/merlin32-action@master
|
||||||
|
# apple2-assembly-github-actions-ci-example
|
||||||
|
Example project showing how to achieve Continuous Integration with Github Actions to assemble 65xx source, package it in a ProDOS disk image, and release it on Github.
|
||||||
|
|
||||||
|
# Explanation
|
||||||
|
This project contains a 6502 assembly language source file called `src/example.s` that can be assembled and run on an Apple II.
|
||||||
|
|
||||||
|
But how do we do that?
|
||||||
|
|
||||||
|
We use Github Actions to install the Merlin32 assembler and CADIUS disk image tool to assemble our source file and put the resulting object on a disk image.
|
||||||
|
|
||||||
|
See the project's [`.github/workflows/main.yml`](https://github.com/digarok/apple2-assembly-github-actions-ci-example/blob/master/.github/workflows/main.yml) file to understand how it is automatically built using Github Action.
|
||||||
|
|
||||||
|
## How it works
|
||||||
|
The main project workflow file above has the following logic:
|
||||||
|
|
||||||
|
- Any time new code is pushed:
|
||||||
|
- Build it with Merlin32 and report back success
|
||||||
|
- Any time we push a new version tag:
|
||||||
|
- Build it with Merlin32
|
||||||
|
- Create a new ProDOS disk image with Cadius
|
||||||
|
- Copy ProDOS system and our assembled objects to the image
|
||||||
|
- Upload the new disk image to our Github Release page for anyone to download and use immediately!
|
||||||
|
|
||||||
|
Uses:
|
||||||
|
- [`digarok/install-merlin32-action@v0.1.0`](https://github.com/marketplace/actions/install-merlin32-action)
|
||||||
|
- [`digarok/install-cadius-action@v0.1.0`](https://github.com/marketplace/actions/install-cadius-action)
|
41
src/example.s
Normal file
41
src/example.s
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
****************************************
|
||||||
|
* Example *
|
||||||
|
* *
|
||||||
|
* Dagen Brock <dagenbrock@gmail.com> *
|
||||||
|
* 2020-02-10 *
|
||||||
|
****************************************
|
||||||
|
|
||||||
|
org $2000 ; start at $2000 (all ProDOS8 system files)
|
||||||
|
dsk example.system ; tell compiler what name for output file
|
||||||
|
typ $ff ; set P8 type ($ff = "SYS") for output file
|
||||||
|
|
||||||
|
MLI equ $bf00
|
||||||
|
|
||||||
|
Main ldx #0
|
||||||
|
|
||||||
|
:lp1 lda _demoStr,x
|
||||||
|
beq :doneStr
|
||||||
|
sta $400,x
|
||||||
|
inx
|
||||||
|
bne :lp1
|
||||||
|
|
||||||
|
:doneStr jsr $FD0C ; wait for key
|
||||||
|
jmp Quit
|
||||||
|
|
||||||
|
|
||||||
|
_demoStr STR "WELCOME TO THE FUTURE.",00
|
||||||
|
|
||||||
|
Quit jsr MLI ; first actual command, call ProDOS vector
|
||||||
|
dfb $65 ; with "quit" request ($65)
|
||||||
|
da QuitParm
|
||||||
|
bcs Error
|
||||||
|
brk $00 ; shouldn't ever here!
|
||||||
|
|
||||||
|
QuitParm dfb 4 ; number of parameters
|
||||||
|
dfb 0 ; standard quit type
|
||||||
|
da $0000 ; not needed when using standard quit
|
||||||
|
dfb 0 ; not used
|
||||||
|
da $0000 ; not used
|
||||||
|
|
||||||
|
|
||||||
|
Error brk $00 ; shouldn't be here either
|
Loading…
Reference in New Issue
Block a user