Add release pipeline #2
This file contains hidden or 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: U3A Build Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| export-kicad: | |
| env: | |
| BaseFileName: "U3A" | |
| SchematicFileExtension: "kicad_sch" | |
| PCBFileExtension: "kicad_pcb" | |
| OutputFolder: "./output" | |
| ConfigFilePath: ".kibot/build.kibot.yaml" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repository | |
| uses: actions/checkout@v4 | |
| - name: Prepare output directory | |
| run: | | |
| mkdir -p ${{ env.OutputFolder }} | |
| cp -r ./pcb ${{ env.OutputFolder }}/kicad | |
| cp ./LICENSE.md ${{ env.OutputFolder }} | |
| - name: Run KiBOT | |
| uses: INTI-CMNB/KiBot@v2_dk7 | |
| with: | |
| config: ${{ env.ConfigFilePath }} | |
| dir: ${{ env.OutputFolder }} | |
| schema: "./pcb/${{ env.BaseFileName }}.${{ env.SchematicFileExtension }}" | |
| board: "./pcb/${{ env.BaseFileName }}.${{ env.PCBFileExtension }}" | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kicad-export | |
| path: ${{ env.OutputFolder }} | |
| retention-days: 1 | |
| export-freecad: | |
| env: | |
| FREECADVERSION: "1.0.2" | |
| FreeCADFileName: "./mechanical/housing.FCStd" | |
| OutputFolder: "./output" | |
| PartType: "PartDesign::Body" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repository | |
| uses: actions/checkout@v4 | |
| - name: Prepare output directory | |
| run: | | |
| mkdir -p ${{ env.OutputFolder }} | |
| cp -r ./mechanical ${{ env.OutputFolder }} | |
| cp ./LICENSE.md ${{ env.OutputFolder }} | |
| - name: Install FreeCAD | |
| run: | | |
| wget https://github.com/FreeCAD/FreeCAD/releases/download/${{ env.FREECADVERSION }}/FreeCAD_${{ env.FREECADVERSION }}-conda-Linux-x86_64-py311.AppImage | |
| chmod 0777 FreeCAD_${{ env.FREECADVERSION }}-conda-Linux-x86_64-py311.AppImage | |
| ./FreeCAD_${{ env.FREECADVERSION }}-conda-Linux-x86_64-py311.AppImage --appimage-extract | |
| - name: Get FreeCAD Export | |
| run: | | |
| git clone https://github.com/0x007E/pyfreecadexport.git | |
| - name: Export STEP Files | |
| run: | | |
| ./squashfs-root/usr/bin/python ./pyfreecadexport/src/pyfreecadexport.py -f "${{ env.FreeCADFileName }}" -p "${{ env.PartType }}" -d "${{ env.OutputFolder }}" -e "step" -l "squashfs-root/usr/lib/" | |
| ./squashfs-root/usr/bin/python ./pyfreecadexport/src/pyfreecadexport.py -f "${{ env.FreeCADFileName }}" -p "${{ env.PartType }}" -d "${{ env.OutputFolder }}" -e "stl" -l "squashfs-root/usr/lib/" | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: freecad-export | |
| path: ${{ env.OutputFolder }} | |
| retention-days: 1 |