Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
# This workflow setup was modified from: https://github.com/MicroType-Engineering/nuco-v-kibot-test
# This workflow generates documentation (PDFs, interactive BOMs, board images) and fabrication
# files for JLCPCB and PCBWay. The version number and date of the design is automatically
# updated in the schematic file and on the PCB based on the GitHub release version and date.
# To use this workflow in your own repo you need to edit the environment variables in the env: section
# below.
name: "Manual Release Assets"
on:
workflow_dispatch:
jobs:
FabricationAndDocumentation:
env:
# Set this to the base filename of your project.
BaseFileName: soil-moisture-sensor
BaseDir: hardware
# Set this to your local timezone. See https://www.wikiwand.com/en/List_of_tz_database_time_zones for valid strings.
Timezone: Etc/UTC
# Set this to the output folder for all of the generated files. Unless you have a very
# good reason to change this you should leave it as KiBotOutput.
OutputFolder: KiBotOutput
runs-on: ubuntu-latest
# These are all the steps that generate the files.
steps:
# Check out the files
- uses: actions/checkout@v3
with:
submodules: 'recursive'
# Install Openscad
- name: Install openscad
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends openscad
# Get the version of the GitHub release for use later.
- name: Get GitHub release version
id: get_version
uses: battila7/get-version-action@v2
if: startsWith(github.ref, 'refs/tags/')
# Actually run KiBot to generate all the files. The KiBot scripts used are
# in the .kibot/ folder.
- name: Generate documentation files
uses: INTI-CMNB/KiBot@v2_k6
with:
config: .kibot/documentation.kibot.yaml
dir: ${{ env.OutputFolder }}
schema: "${{ env.BaseDir }}/${{ env.BaseFileName }}.kicad_sch"
board: "${{ env.BaseDir }}/${{ env.BaseFileName }}.kicad_pcb"
- name: Generate production files
uses: INTI-CMNB/KiBot@v2_k6
with:
config: .kibot/production.kibot.yaml
dir: ${{ env.OutputFolder }}
schema: "${{ env.BaseDir }}/${{ env.BaseFileName }}.kicad_sch"
board: "${{ env.BaseDir }}/${{ env.BaseFileName }}.kicad_pcb"
# Generate the case STLs
- name: Generate case base STL
run: openscad ${{ env.BaseDir }}/case/case.scad -o ${{ env.BaseDir }}/case/base-${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}.stl -D 'part="base"'
- name: Generate case shell STL
run: openscad ${{ env.BaseDir }}/case/case.scad -o ${{ env.BaseDir }}/case/shell-${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}.stl -D 'part="shell"'
# 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 documentation
run: zip -qq -r "../../${{ env.BaseFileName }}-documentation.zip" .
working-directory: ${{ env.OutputFolder }}/Documentation
- name: Zip production
run: zip -qq -r "../../${{ env.BaseFileName }}-production.zip" .
working-directory: ${{ env.OutputFolder }}/Gerbers
# Upload all the zip files to the release.
- name: Upload release files
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.BaseFileName }}-documentation.zip
${{ env.BaseFileName }}-production.zip
${{ env.BaseDir }}/case/base-${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}.stl
${{ env.BaseDir }}/case/shell-${{ steps.get_version.outputs.major }}.${{ steps.get_version.outputs.minor }}.stl
d252a7cbcThis file is pinned to the selected release. Download the original to open it in your design tool.