Skip to content
Merged
116 changes: 116 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: CI

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
container:
image: fozztexx/defoogi:1.4.2

outputs:
files: ${{ steps.list_zips.outputs.files }}

steps:
- uses: actions/checkout@v4

- name: Build release files
run: make release

- name: List zip files
id: list_zips
shell: bash
run: |
echo 'files=["'"$(( cd dist ; echo *.zip ) | sed -e 's/ /","/g')"'"]' >> $GITHUB_OUTPUT

- name: Upload dist folder for next job
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

upload:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
file: ${{ fromJson(needs.build.outputs.files) }}
steps:
- uses: actions/checkout@v4

- name: Download dist folder
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Upload individual artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.file }}
path: dist/${{ matrix.file }}

tagged-release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

# Download the dist folder from the build job
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist

# Create GitHub Release for the tag
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Upload each zip as a release asset
- name: Upload release assets
run: |
for zip in dist/*.zip; do
echo "Uploading $zip..."
gh release upload ${{ github.ref_name }} "$zip"
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

push-changelog:
name: "Push Change Log"
needs: tagged-release
runs-on: ubuntu-latest
env:
TAG_NAME: ${{ github.event.inputs.tag || github.ref_name }}
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Save commits to change log
run: git log $(git describe --tags --abbrev=0 @^ 2> /dev/null)..@ --oneline > CHANGE.log

- name: Upload Change Log
uses: actions/upload-artifact@v4
with:
name: CHANGE.log
path: CHANGE.log

- name: Push Change log to Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
files: CHANGE.log
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Set the TARGETS and PROGRAM values as required.
# See makefiles/build.mk for details on directory structure for src files and how to add custom extensions to the build.

TARGETS = adam atari c64 apple2 apple2enh apple2gs coco
# TARGETS = pmd85
# TARGETS = msdos
TARGETS = adam atari c64 apple2 coco
# TARGETS += apple2enh # obsolete, removed from cc65
# TARGETS += apple2gs
# TARGETS += pmd85
# TARGETS += msdos
PROGRAM := fujinet.lib

SUB_TASKS := clean disk test release unit-test
Expand Down