Giter VIP home page Giter VIP logo

kicad-render's Introduction

kicad render action

KiCad render  - for gitlab

This action allows you to automatically render Images of your PCB and use them e.g. in a README.md

current state

This is using Kicad nightly since there is yet no Kicad release containing the image rendering command in the CLI.

Usage

  1. Create the directory .github/workflows if it does not already exist.

  2. Add a new yaml in that directory e.g. pcb_image.yaml

  3. Adding the configuration. Set the path to your .kicad_pcb file (you may need to replace 'refs/heads/main' with 'refs/heads/master' on older repos)

    name: pcb_image
    on:
      push:
    jobs:
      render-image:
        name: render-image
        runs-on: ubuntu-latest
        steps:
          - name: Check out the repo
            uses: actions/checkout@v4
    
          - name: render pcb image
            uses: linalinn/kicad-render@main
            with:
            pcb_file: <path from repo root to .kicad_pcb>
            output_path: ${{ github.workspace }}/images
            
          - name: Setup Pages
            if: github.ref == 'refs/heads/main'
            uses: actions/configure-pages@v3
    
          - name: Upload Artifact
            if: github.ref == 'refs/heads/main'
            uses: actions/upload-pages-artifact@v1
            with:
            path: "images"
    
      deploy-pages:
        if: github.ref == 'refs/heads/main'
        runs-on: ubuntu-latest
        needs: render-image
          
        permissions:
          pages: write
          id-token: write
    
        environment:
          name: github-pages
          url: ${{ steps.deployment.outputs.page_url }}
    
        steps:
          - name: Deploy to GitHub Pages
            id: deployment
            uses: actions/deploy-pages@v2
  4. Adding the images to an README.md

    # My first PCB with automatic image generation
    
    ### Images
    ![top](<github_username>.github.io/<repo_name>/top.png)
    ![bottom](<github_username>.github.io/<repo_name>/bottom.png)
  5. Prepare the repo

    • Open your repo on GitHub
    • Open Setting
    • (Left side) Click on Pages
    • Under Build and deployment select for Source Github Action from the dropdown.
  6. git commit and push

Example

You can find a example here in the m2sdr and the workflow for it here

Animation original code

The code for the Animation is from arturo182
Mastdon post with Gif and link to gist

kicad-render's People

Contributors

linalinn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.