Skip to content

v4.0.0 - REV05 Motherboard, Control Box, Dual Drag Chain #82

v4.0.0 - REV05 Motherboard, Control Box, Dual Drag Chain

v4.0.0 - REV05 Motherboard, Control Box, Dual Drag Chain #82

Workflow file for this run

name: Export ECAD
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
export-ecad:
name: Export ECAD
runs-on: ubuntu-latest
container: ghcr.io/inti-cmnb/kicad8_auto
steps:
- name: Generate Short SHA Environment Variable
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Update system repositories, Install Required Libraries and Initialize git-lfs
run: |
apt update
apt -y install git git-lfs zip librsvg2-bin imagemagick
git lfs install
- name: Checkout Repository
uses: actions/checkout@v2
with:
lfs: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Update the PCBs with on default branch with git hash
if: github.event_name == 'release' || steps.extract_branch.outputs.branch == env.main_branch
run: |
export COMMIT=$(git rev-parse --short HEAD)
echo "COMMIT = ${COMMIT}"
echo "ref: ${{ github.ref }}"
echo "default: ${{ env.default }}"
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/mobo/mobo.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/ring-light/ringLight.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/staging-plate/staging-plate.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/datum/datum.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/ftp/ftp.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/x-cable-chain-support/x-cable-chain-support.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/xy-limit/xy-limit.kicad_pcb
sed -i "s!<<hash>>!${COMMIT}!" pnp/pcb/z-limit/z-limit.kicad_pcb
- name: Update the PCBs with the git hash and BETA.
if: steps.extract_branch.outputs.branch != env.main_branch
run: |
export COMMIT=$(git rev-parse --short HEAD)
echo "COMMIT = ${COMMIT}"
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/mobo/mobo.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/ring-light/ringLight.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/staging-plate/staging-plate.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/datum/datum.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/ftp/ftp.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/x-cable-chain-support/x-cable-chain-support.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/xy-limit/xy-limit.kicad_pcb
sed -i "s!<<hash>>!BETA-${COMMIT}!" pnp/pcb/z-limit/z-limit.kicad_pcb
#mobo
- name: Generate Mobo Export Files
run: |
cd pnp/pcb/mobo
rm -rf mobo/
kibot -c ../../../.github/workflows/scripts/kibot/config-4layer.kibot.yaml -e mobo.kicad_sch -b mobo.kicad_pcb -d mobo
zip -r -j mobo.zip mobo/
#ringlight
- name: Generate Ring Light Export Files
run: |
cd pnp/pcb/ring-light
rm -rf ringLight/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e ringLight.kicad_sch -b ringLight.kicad_pcb -d ringLight
zip -r -j ringLight.zip ringLight/
#datum
- name: Generate Datum Board Export Files
run: |
cd pnp/pcb/datum
rm -rf datum/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e datum.kicad_sch -b datum.kicad_pcb -d datum
zip -r -j datum.zip datum/
#staging-plate
- name: Generate Staging Plate Export Files
run: |
cd pnp/pcb/staging-plate
rm -rf staging-plate/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer-nobom.kibot.yaml -e staging-plate.kicad_sch -b staging-plate.kicad_pcb -d staging-plate
zip -r -j staging-plate.zip staging-plate/
#ftp
- name: Generate FTP Export Files
run: |
cd pnp/pcb/ftp
rm -rf ftp/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e ftp.kicad_sch -b ftp.kicad_pcb -d ftp
zip -r -j ftp.zip ftp/
# x cable chain support
- name: Generate X cable chain support Export Files
run: |
cd pnp/pcb/x-cable-chain-support
rm -rf x-cable-chain-support/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e x-cable-chain-support.kicad_sch -b x-cable-chain-support.kicad_pcb -d x-cable-chain-support
zip -r -j x-cable-chain-support.zip x-cable-chain-support/
# xy limit
- name: Generate XY Limit Export Files
run: |
cd pnp/pcb/xy-limit
rm -rf xy-limit/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e xy-limit.kicad_sch -b xy-limit.kicad_pcb -d xy-limit
zip -r -j xy-limit.zip xy-limit/
# z limit
- name: Generate X cable chain support Export Files
run: |
cd pnp/pcb/z-limit
rm -rf z-limit/
kibot -c ../../../.github/workflows/scripts/kibot/config-2layer.kibot.yaml -e z-limit.kicad_sch -b z-limit.kicad_pcb -d z-limit
zip -r -j z-limit.zip z-limit/
# Zip and Upload
- name: Zip Mobo Export Files for Artifacts
run: |
cd pnp/pcb/
zip -r -j LumenPnP-PCBs.zip mobo/mobo.zip ring-light/ringLight.zip datum/datum.zip staging-plate/staging-plate.zip ftp/ftp.zip x-cable-chain-support/x-cable-chain-support.zip xy-limit/xy-limit.zip z-limit/z-limit.zip
- name: Zip Mobo Export Files for Release
run: |
cd pnp/pcb/
zip -r -j LumenPnP-PCBs-${{ github.event.release.tag_name }}.zip mobo/mobo.zip ring-light/ringLight.zip datum/datum.zip staging-plate/staging-plate.zip ftp/ftp.zip x-cable-chain-support/x-cable-chain-support.zip xy-limit/xy-limit.zip z-limit/z-limit.zip
- name: Upload Mobo Export Files as Artifacts
uses: actions/upload-artifact@v4
with:
name: LumenPnP-PCBs.zip
path: pnp/pcb/LumenPnP-PCBs.zip
if-no-files-found: error
retention-days: 60
- name: Upload Artifacts to Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
pnp/pcb/LumenPnP-PCBs-${{ github.event.release.tag_name }}.zip