From 87b36414d925ceabeaca4c27c79ccbaa1111e783 Mon Sep 17 00:00:00 2001 From: Dagen Brock Date: Mon, 10 Feb 2020 12:04:41 -0600 Subject: [PATCH] CICD Example with CADIUS and Merlin32 Github Actions --- .github/workflows/main.yml | 47 ++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++ README.md | 33 ++++++++++++++++++++++++++ src/example.s | 41 +++++++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 src/example.s diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..911dd8d --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1388220 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..33d2adb --- /dev/null +++ b/README.md @@ -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) diff --git a/src/example.s b/src/example.s new file mode 100644 index 0000000..e05b9f2 --- /dev/null +++ b/src/example.s @@ -0,0 +1,41 @@ +**************************************** +* Example * +* * +* Dagen Brock * +* 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