Rev 2 Board #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Button Hardware | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "*" | |
pull_request: | |
paths: | |
- "Hardware/**" | |
# - ".github/**" | |
jobs: | |
KiCad_Hardware: | |
runs-on: ubuntu-latest | |
name: SuperButton Hardware | |
strategy: | |
matrix: | |
variant: | |
- SuperButtonX1 | |
- SuperButtonX3 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- uses: INTI-CMNB/KiBot@v2_k7 | |
with: | |
# Config file | |
config: Hardware/${{ matrix.variant }}.yaml | |
# Prefix for output in config file. | |
dir: _hardwareOutput | |
# Hardware Files | |
schema: "Hardware/${{ matrix.variant }}/${{ matrix.variant }}.kicad_sch" | |
board: "Hardware/${{ matrix.variant }}/${{ matrix.variant }}.kicad_pcb" | |
- name: upload results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.variant }} | |
path: _hardwareOutput | |
- name: Discord notification if failed | |
if: ${{ failure() }} | |
uses: appleboy/discord-action@master | |
with: | |
webhook_id: ${{ secrets.WEBHOOK_ID }} | |
webhook_token: ${{ secrets.WEBHOOK_TOKEN }} | |
args: "Building new board failed, most likely a DRC check." | |
# make_docs: | |
# runs-on: ubuntu-latest | |
# name: Build Docs | |
# needs: [KiCad_Hardware] | |
# steps: | |
# - name: Setup Python | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: "3.10" | |
# architecture: x64 | |
# - uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - run: sudo apt update | |
# - run: sudo apt install texlive-latex-recommended texlive-latex-extra texlive-pictures pandoc rename latexmk inkscape imagemagick | |
# - name: Install requirements | |
# run: pip install -r Docs/requirements.txt | |
# # Download artifacts from other builds | |
# - uses: actions/download-artifact@v3 | |
# with: | |
# name: Board-Hardware | |
# path: _hardwareOutput | |
# # Convert svg graphics | |
# - run: convert -density 300 _hardwareOutput/LC-Mainboard-schematic.svg _hardwareOutput/LC-Mainboard-schematic.png | |
# - run: cd Docs && make latexpdf | |
# - run: mv Docs/_build/latex/*.pdf Docs/_build/latex/Board-Manual.pdf | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: Board-Manual | |
# path: Docs/_build/latex/Board-Manual.pdf | |
dev-publish: | |
# publish only to devs | |
runs-on: ubuntu-latest | |
name: Dev-Publish | |
# needs: [make_docs, KiCad_Hardware] | |
needs: [KiCad_Hardware] | |
strategy: | |
matrix: | |
variant: | |
- SuperButtonX1 | |
- SuperButtonX3 | |
steps: | |
# Download artifacts | |
# - uses: actions/download-artifact@v3 | |
# with: | |
# name: Board-Manual | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.variant }} | |
# - name: send custom message with args | |
# uses: appleboy/discord-action@master | |
# with: | |
# webhook_id: ${{ secrets.WEBHOOK_ID }} | |
# webhook_token: ${{ secrets.WEBHOOK_TOKEN }} | |
# file: "Board-Manual.pdf" | |
# args: Display Board Just got an update! | |
- name: send custom message with args | |
uses: appleboy/discord-action@master | |
with: | |
webhook_id: ${{ secrets.WEBHOOK_ID }} | |
webhook_token: ${{ secrets.WEBHOOK_TOKEN }} | |
file: "${{ matrix.variant }}-3D_top.png" | |
args: ${{ matrix.variant }} | |
publish: | |
# Only run on tags | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
name: Publish | |
# needs: [make_docs, KiCad_Hardware] | |
needs: [KiCad_Hardware] | |
strategy: | |
matrix: | |
variant: | |
- SuperButtonX1 | |
- SuperButtonX3 | |
steps: | |
# Be in our repo | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Download artifacts | |
# - uses: actions/download-artifact@v3 | |
# with: | |
# name: Board-Manual | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.variant }} | |
- run: mkdir -p _staging/ | |
# - run: cp *.pdf _staging/ | |
- run: cp *.step _staging/ | |
# Copy gerbers | |
- run: cp PCBWay/*.zip _staging/${{ matrix.variant }}-$(git rev-parse --short HEAD)-PCBWay.zip | |
- run: cp JLCPCB/*.zip _staging/${{ matrix.variant }}-$(git rev-parse --short HEAD)-JLCPCB.zip | |
# Copy BOMs | |
- run: cp *.csv _staging/ | |
- name: Upload Docs to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: "_staging/*" | |
tag: ${{ github.ref }} | |
overwrite: true | |
prerelease: true | |
body: "Concord Robotics, Automated with github ci/cd." | |
file_glob: true |