workflow debugging #71
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: Compile production files | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
# backpack-board-bundle: | |
# runs-on: ubuntu-latest | |
# # These are all the steps that generate the files. | |
# steps: | |
# # Check out the files | |
# - uses: actions/checkout@v3 | |
# with: | |
# submodules: true | |
# # Install the zip command line tool to package up the output | |
# - name: Install zip | |
# uses: montudor/action-zip@v1 | |
# # Zip all the documentation. Any files in the PCBWay, PDFs, Renders, and Schematic subfolder | |
# # are automatically included. | |
# - name: Zip project template | |
# run: zip -qq -r backpack-template.zip ./backpack-template/ | |
# working-directory: . | |
# # Upload all the zip files to the release. | |
# - name: Upload release files | |
# uses: softprops/action-gh-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# files: backpack-template.zip | |
compile-production-files: | |
runs-on: ubuntu-latest | |
# needs: esphome-firmware-validation | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: KiCAD main config file (kicad_common.json) | |
run: | | |
sudo mkdir -p $HOME/.config/kicad/7.0/ | |
sudo chown -R $(id -u):$(id -g) $HOME/.config/kicad/7.0/ | |
jq -n '{"environment": {"vars": { | |
"SLIMC_3DMODELS":"'$PWD'/esp-stepper-servo/dependencies/kicad-libraries/slimc/3d-packages", | |
"ESPRESSIF_3DMODELS":"'$PWD'/esp-stepper-servo/dependencies/kicad-libraries/espressif-kicad-libraries/3d", | |
}}}' > $HOME/.config/kicad/7.0/kicad_common.json | |
- run: | | |
ls -al $HOME/.config/kicad/7.0/ | |
cat $HOME/.config/kicad/7.0/kicad_common.json | |
- name: Generate full documentation | |
uses: INTI-CMNB/KiBot@v2_k7 | |
with: | |
config: .kibot/full-outputs.kibot.yaml | |
dir: . | |
schema: electronics/driver-board.kicad_sch | |
board: electronics/driver-board.kicad_pcb | |
- name: Fix file permissions for generated files | |
run: sudo chown -R $(id -u):$(id -g) ./exports | |
- name: Get current date and time | |
id: gitstamp | |
run: echo "::set-output name=datehash::$(git log -1 --format='%as')-$(git log -1 --pretty=format:%h)" | |
# TODO: dynamic expand all images with date and commit hash | |
# - name: Copy renders to static folder | |
# run: | | |
# set -e | |
# FONT=".github/artifacts/fonts/RobotoMono-Bold.ttf" | |
# set -v | |
# LABEL="`${{ steps.date.outputs.date }}`\n`git rev-parse --short HEAD`" | |
# convert -background black -fill white -pointsize 12 -font "$FONT" -size 300x36 label:"$LABEL" -bordercolor black -border 3 exports/renders/*.png +swap -append exports/renders/*.png | |
- name: Commit renders to static folder | |
run: | | |
mkdir -p static/images/ | |
cp -r exports/renders/*.png static/images/ | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add -f static/images | |
git commit -m "latest renders" | |
git push | |
- name: Archive project artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: driver-board-${{ steps.gitstamp.outputs.datehash }} | |
if-no-files-found: error | |
path: | | |
# Documentations | |
exports/driver-board-schematic-*.pdf | |
exports/driver-board-pcb-layers-*.pdf | |
exports/datasheets | |
# Production files | |
exports/gerbers/*.zip | |
exports/driver-board-bom-*.csv | |
## Design report | |
exports/driver-board-design-report-*.csv | |
# driver-board-report.pdf | |
## Extras | |
exports/renders/*.png | |
exports/driver-board-*.step |