Skip to content

Build

Build #68

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: 42 06 9 * *
jobs:
make:
name: make
runs-on: ubuntu-latest
strategy:
matrix:
make-config: [
{mcu: 'at90usb1286', arch: 'AVR8', f-cpu: 16000000},
{mcu: 'atmega16u2', arch: 'AVR8', f-cpu: 16000000},
{mcu: 'atmega32u4', arch: 'AVR8', f-cpu: 16000000},
]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Compile for ${{ matrix.make-config.mcu }}
uses: docker://lpodkalicki/avr-toolchain
with:
entrypoint: make
args: MCU=${{ matrix.make-config.mcu }} ARCH=${{ matrix.make-config.arch }} F_CPU=${{ matrix.make-config.f-cpu }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.make-config.mcu }} ${{ matrix.make-config.arch }} ${{ matrix.make-config.f-cpu }}
path: |
obj
*.bin
*.eep
*.elf
*.hex
*.lss
*.map
*.sym
- name: Extract release files
run: mkdir -p .action_build_outputs && mv Joystick.hex .action_build_outputs/Joystick-${{ matrix.make-config.mcu }}.hex && mv Joystick.elf .action_build_outputs/Joystick-${{ matrix.make-config.mcu }}.elf && mv Joystick.bin .action_build_outputs/Joystick-${{ matrix.make-config.mcu }}.bin && mv Joystick.lss .action_build_outputs/Joystick-${{ matrix.make-config.mcu }}.lss
- name: Append release files to release artifact
uses: actions/upload-artifact@v3
with:
name: release
path: |
.action_build_outputs/*
release:
name: Create release
runs-on: ubuntu-latest
needs: make
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Download release artifact
uses: actions/download-artifact@v3
with:
name: release
path: .action_release
- name: Create release on GitHub
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: Latest build
files: |
.action_release/*