add extra files to hardware outputs #11
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: Bundle Release files | |
on: push | |
jobs: | |
bundle: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup | |
run: | | |
sudo apt update | |
sudo apt install -y wget libgl1 texlive-latex-base texlive-latex-extra latexmk | |
sudo pip install sphinx==6.1.3 sphinx-rtd-theme==1.2.0 | |
- name: Get freecad from cache | |
id: cache-freecad | |
uses: actions/cache@v3 | |
with: | |
path: ~/bin/freecad | |
key: freecad-0.21.1 | |
- if: ${{ steps.cache-freecad.outputs.cache-hit != 'true' }} | |
name: Get freecad from github | |
run: | | |
mkdir ~/bin/ | |
wget -O ~/bin/freecad https://github.com/FreeCAD/FreeCAD/releases/download/0.21.1/FreeCAD_0.21.1-Linux-x86_64.AppImage | |
chmod 755 ~/bin/freecad | |
- uses: actions/cache/save@v3 | |
if: always() | |
with: | |
path: ~/bin/freecad | |
key: freecad-0.21.1 | |
- name: install freecad modules | |
run: | | |
mkdir -p ~/.local/share/FreeCAD/Mod | |
cd ~/.local/share/FreeCAD/Mod | |
git clone https://github.com/mwganson/ThreadProfile | |
git clone https://github.com/shaise/FreeCAD_FastenersWB | |
- name: export hardware files | |
run: | | |
ls | |
cd case | |
~/bin/freecad --appimage-extract-and-run -c export_hardware.py | |
cd build | |
zip -r ../../hardware.zip * | |
- name: export firmware files | |
run: | | |
cd firmware | |
zip ../firmware.zip *.py | |
- name: generate manual | |
run: | | |
cd firmware/docs | |
make latexpdf | |
cp build/latex/sap6.pdf ../../manual.pdf | |
- name: 'Upload Artifacts' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: | | |
hardware.zip | |
firmware.zip | |
manual.pdf | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
generate_release_notes: true | |
files: | | |
hardware.zip | |
firmware.zip | |
manual.pdf |