Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
name: Build
on:
push:
branches:
- master
paths:
- '.github/workflows/build.yaml'
- 'Firmware/**'
- '!Firmware/unit_tests/**'
- '!Firmware/.vscode/**'
- '!**.md'
pull_request:
paths:
- 'Firmware/**'
- '!Firmware/unit_tests/**'
- '!Firmware/.vscode/**'
- '!**.md'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Checkout submodules
uses: textbook/git-checkout-submodule-action@master
- name: Install Python packages
run: pip3 install ninja
- name: Install Python 2 packages
run: pip2 install intelhex
- name: Setup ninja-build
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup ARM GNU tools
run: sudo .github/workflows/setup_gnu_arm_embedded_toolchain
- name: Setup llvm
run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: Build
run: |
export PATH=$PATH:/opt/gcc-arm-none-eabi-9-2019-q4-major/bin &&
cd Firmware &&
ninja | tee build_log.txt
- name: Upload build log
uses: actions/upload-artifact@v1
with:
name: build_log
path: Firmware/build_log.txt
- name: Get version
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
id: get_version
run: echo "::set-output name=version::$(./Firmware/get_version)"
- name: Compress output files
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
cd Firmware/output &&
ls midi-grid.* >/dev/null &&
7z a midi-grid_${{ steps.get_version.outputs.version }}.7z midi-grid.*
- name: Create Release
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: ${{ steps.get_version.outputs.version }}
draft: false
prerelease: contains( ${{ steps.get_version.outputs.version }}, 'pre' )
- name: Upload Release Asset
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
id: upload-release-asset
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: Firmware/output/midi-grid_${{ steps.get_version.outputs.version }}.7z
asset_name: midi-grid_${{ steps.get_version.outputs.version }}.7z
asset_content_type: application/7z
527ad3734This file is pinned to the selected release. Download the original to open it in your design tool.