Skip to content

gottlieb to 4bit and planes to 6 (#23) #248

gottlieb to 4bit and planes to 6 (#23)

gottlieb to 4bit and planes to 6 (#23) #248

Workflow file for this run

name: dmdreader
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
version:
name: Detect version
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: version
run: |
TAG=`cat VERSION`
echo "${TAG}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Check git tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
GIT_TAG="${GITHUB_REF#refs/tags/}"
EXPECTED_TAG="v${{ steps.version.outputs.tag }}"
if [[ "${GIT_TAG}" != "${EXPECTED_TAG}" ]]; then
echo "Error: Git tag (${GIT_TAG}) does not match version string from VERSION file (v${{ steps.version.outputs.tag }})"
exit 1
fi
build:
runs-on: ubuntu-latest
needs: [ version ]
strategy:
fail-fast: false
matrix:
dmd: ['ppucdmd', 'ppucdmd2', 'alphadmd']
name: Build for ${{ matrix.dmd }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v5
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio rich_click intelhex
- name: Build dmdreader
run: |
pio run -e ${{ matrix.dmd }}
cp .pio/build/${{ matrix.dmd }}/firmware.elf dmdreader-${{ matrix.dmd }}.elf
cp .pio/build/${{ matrix.dmd }}/firmware.uf2 dmdreader-${{ matrix.dmd }}.uf2
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dmdreader-${{ matrix.dmd }}
path: |
dmdreader-${{ matrix.dmd }}.elf
dmdreader-${{ matrix.dmd }}.uf2
VERSION
LICENSE
README.md
post-build:
runs-on: ubuntu-latest
needs: [ version, build ]
name: Release
steps:
- uses: actions/download-artifact@v4
- name: Package
if: startsWith(github.ref, 'refs/tags/v')
run: |
cd dmdreader-ppucdmd
zip ../dmdreader-ppucdmd.zip dmdreader-ppucdmd.elf dmdreader-ppucdmd.uf2 VERSION LICENSE README.md
cd ../dmdreader-ppucdmd2
zip ../dmdreader-ppucdmd2.zip dmdreader-ppucdmd2.elf dmdreader-ppucdmd2.uf2 VERSION LICENSE README.md
cd ../dmdreader-alphadmd
zip ../dmdreader-alphadmd.zip dmdreader-alphadmd.elf dmdreader-alphadmd.uf2 VERSION LICENSE README.md
cd ..
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
files: |
dmdreader-ppucdmd.zip
dmdreader-ppucdmd2.zip
dmdreader-alphadmd.zip