Rearrange text on fabrication layer #8
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: DIU Build Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| export-kicad: | |
| env: | |
| BaseFileName: "DIU" | |
| 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 ${{ 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 ${{ 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 | |
| build-firmware: | |
| env: | |
| TOOLCHAIN: "3.7.0.1796" | |
| DFP: "ATtiny_DFP.2.0.368" | |
| DEVICE: "attiny1606" | |
| OutputFolder: "./output" | |
| FirmwareName: "DIU_FW_1_0" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repository | |
| uses: actions/checkout@v4 | |
| - name: Copy License | |
| run: | | |
| mkdir ${{ env.OutputFolder }} | |
| cp ./LICENSE ${{ env.OutputFolder }} | |
| - name: Install zip | |
| run: sudo apt-get install -y zip | |
| - name: install-build-tools | |
| run: | | |
| wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/avr8-gnu-toolchain-${{ env.TOOLCHAIN }}-linux.any.x86_64.tar.gz | |
| tar -xf *.tar.gz | |
| - name: install-dfp-package | |
| run: | | |
| wget http://packs.download.atmel.com/Atmel.${{ env.DFP }}.atpack | |
| unzip *.atpack -d ./DFP | |
| - name: build-firmware | |
| run: | | |
| mkdir temp | |
| libraries="" | |
| for dir in ./firmware/lib/*/ | |
| do | |
| name=${dir%*/} | |
| echo "Building ${name##*/}" | |
| first_file=$(ls ./firmware/lib/${name##*/}/*.c| head -1) | |
| filename=$(basename -- "$first_file") | |
| filename="${filename%.*}" | |
| ./avr8-gnu-toolchain-linux_x86_64/bin/avr-gcc -g -x c -O1 -mmcu=${{ env.DEVICE }} -std=gnu99 -B ./DFP/gcc/dev/${{ env.DEVICE }} -I ./DFP/include -c ./firmware/lib/${name##*/}/${filename}.c -o ./temp/${filename}.o | |
| libraries+="./temp/${filename}.o " | |
| done | |
| ./avr8-gnu-toolchain-linux_x86_64/bin/avr-gcc -g -x c -O1 -mmcu=${{ env.DEVICE }} -std=gnu99 -B ./DFP/gcc/dev/${{ env.DEVICE }} -I ./DFP/include -c ./firmware/${{ env.FirmwareName }}/main.c -o ./temp/main.o | |
| ./avr8-gnu-toolchain-linux_x86_64/bin/avr-gcc -g -mmcu=${{ env.DEVICE }} -B ./DFP/gcc/dev/${{ env.DEVICE }} -I ./DFP/include -o ./temp/main.elf ./temp/main.o ${libraries} | |
| ./avr8-gnu-toolchain-linux_x86_64/bin/avr-objcopy -j .text -j .data -O ihex ./temp/main.elf ${{ env.OutputFolder }}/${{ env.FirmwareName }}_t1606.hex | |
| ./avr8-gnu-toolchain-linux_x86_64/bin/avr-objcopy -j .eeprom --change-section-lma .eeprom=0 -O ihex ./temp/main.elf ${{ env.OutputFolder }}/${{ env.FirmwareName }}_t1606.eep | |
| tar -czvf build.tar.gz ${{ env.OutputFolder }} | |
| zip -r build.zip ${{ env.OutputFolder }} | |
| - name: upload-firmware | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-build | |
| path: ${{ env.OutputFolder }} | |
| retention-days: 1 |