From 468035c48d7bc464f1b450b380a76c437ed1a76b Mon Sep 17 00:00:00 2001 From: LinaLinn Date: Fri, 22 Mar 2024 23:11:49 +0000 Subject: [PATCH 1/5] Add gitbug workflow for rendering pcb images --- .github/workflows/images.yaml | 43 +++++++++++++++++++++++++++++++++++ .github/workflows/render.sh | 16 +++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/images.yaml create mode 100644 .github/workflows/render.sh diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml new file mode 100644 index 0000000..86894ea --- /dev/null +++ b/.github/workflows/images.yaml @@ -0,0 +1,43 @@ +name: render pcb images +on: + push: +jobs: + render_pcb_images: + name: render pcb images + runs-on: ubuntu-latest + container: + image: ghcr.io/linalinn/kicad-render:nightly + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Render images + run: find ${GITHUB_WORKSPACE} -name "*.kicad_pcb" | grep -v "Third-party" | grep -v "Panels/" | grep -v "_panel" | grep -v "panel.kicad_pcb" | xargs -I {} bash -c "bash $GITHUB_WORKSPACE/.github/workflows/render.sh \"{}\" $GITHUB_WORKSPACE/images" + + - name: Setup Pages + if: github.ref == 'refs/heads/master' + uses: actions/configure-pages@v3 + + - name: Upload Artifact + if: github.ref == 'refs/heads/master' + uses: actions/upload-pages-artifact@v1 + with: + path: "images" + + deploy-pages: + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + needs: render_pcb_images + + 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 \ No newline at end of file diff --git a/.github/workflows/render.sh b/.github/workflows/render.sh new file mode 100644 index 0000000..0856c46 --- /dev/null +++ b/.github/workflows/render.sh @@ -0,0 +1,16 @@ +function extract_project_name { + echo "$1" | rev | cut -d '/' -f 1 | rev | sed -e "s/.kicad//g" +} + +function render { + PCB_FILE="$1" + echo + echo rendering: "$PCB_FILE" + echo + PCB_NAME=$(extract_project_name "$1") + PCB_OUTPUT_PATH="${2}/$PCB_NAME" + mkdir -p "$PCB_OUTPUT_PATH" + render-pcb.sh -f "$PCB_FILE" -o "$PCB_OUTPUT_PATH" +} + +render "$1" "$2" From 3f77be44b1a26e9826b2fd16e6a981ac5e182545 Mon Sep 17 00:00:00 2001 From: LinaLinn Date: Sun, 24 Mar 2024 14:10:44 +0000 Subject: [PATCH 2/5] remove render.sh and render images next to pcb file --- .github/workflows/images.yaml | 2 +- .github/workflows/render.sh | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 .github/workflows/render.sh diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 86894ea..f77d61b 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 - name: Render images - run: find ${GITHUB_WORKSPACE} -name "*.kicad_pcb" | grep -v "Third-party" | grep -v "Panels/" | grep -v "_panel" | grep -v "panel.kicad_pcb" | xargs -I {} bash -c "bash $GITHUB_WORKSPACE/.github/workflows/render.sh \"{}\" $GITHUB_WORKSPACE/images" + run: find ${GITHUB_WORKSPACE} -name "*.kicad_pcb" | grep -v "Third-party" | grep -v "Panels/" | grep -v "_panel" | grep -v "panel.kicad_pcb" | xargs -I {} bash -c "bash render-pcb.sh \"{}\"" - name: Setup Pages if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/render.sh b/.github/workflows/render.sh deleted file mode 100644 index 0856c46..0000000 --- a/.github/workflows/render.sh +++ /dev/null @@ -1,16 +0,0 @@ -function extract_project_name { - echo "$1" | rev | cut -d '/' -f 1 | rev | sed -e "s/.kicad//g" -} - -function render { - PCB_FILE="$1" - echo - echo rendering: "$PCB_FILE" - echo - PCB_NAME=$(extract_project_name "$1") - PCB_OUTPUT_PATH="${2}/$PCB_NAME" - mkdir -p "$PCB_OUTPUT_PATH" - render-pcb.sh -f "$PCB_FILE" -o "$PCB_OUTPUT_PATH" -} - -render "$1" "$2" From 2d7d464a92678ac7d826e0383d6801e571a3c2ac Mon Sep 17 00:00:00 2001 From: LinaLinn Date: Sun, 24 Mar 2024 14:32:58 +0000 Subject: [PATCH 3/5] add missing -f and upload repo to pages --- .github/workflows/images.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index f77d61b..77199a3 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 - name: Render images - run: find ${GITHUB_WORKSPACE} -name "*.kicad_pcb" | grep -v "Third-party" | grep -v "Panels/" | grep -v "_panel" | grep -v "panel.kicad_pcb" | xargs -I {} bash -c "bash render-pcb.sh \"{}\"" + run: find ${GITHUB_WORKSPACE} -name "*.kicad_pcb" | grep -v "Third-party" | grep -v "Panels/" | grep -v "_panel" | grep -v "panel.kicad_pcb" | xargs -I {} bash -c "bash render-pcb.sh -f \"{}\"" - name: Setup Pages if: github.ref == 'refs/heads/master' @@ -22,7 +22,7 @@ jobs: if: github.ref == 'refs/heads/master' uses: actions/upload-pages-artifact@v1 with: - path: "images" + path: "${GITHUB_WORKSPACE}" deploy-pages: if: github.ref == 'refs/heads/master' From 4c8ae3afe350648572d18707c99d4a820427c7b1 Mon Sep 17 00:00:00 2001 From: LinaLinn Date: Sun, 24 Mar 2024 14:45:34 +0000 Subject: [PATCH 4/5] replace GITHUB_WORKSPACE with github.workspace --- .github/workflows/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 77199a3..2d148d2 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -22,7 +22,7 @@ jobs: if: github.ref == 'refs/heads/master' uses: actions/upload-pages-artifact@v1 with: - path: "${GITHUB_WORKSPACE}" + path: "${{ github.workspace }}" deploy-pages: if: github.ref == 'refs/heads/master' From 72086189d99438203767287c991cd89bb010755b Mon Sep 17 00:00:00 2001 From: LinaLinn Date: Sun, 24 Mar 2024 15:03:06 +0000 Subject: [PATCH 5/5] add example for images in README.md --- Laptop mods/framework_input_controller/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Laptop mods/framework_input_controller/README.md b/Laptop mods/framework_input_controller/README.md index bf8840e..dd9f2b7 100644 --- a/Laptop mods/framework_input_controller/README.md +++ b/Laptop mods/framework_input_controller/README.md @@ -32,6 +32,11 @@ giving advice on its integration pinout mismatch issue, checking the EC code when something wasn't clear to me, and helping out with the firmware +## Images + +![top](https://crimier.github.io/MyKiCad/Laptop%20mods/framework_input_controller/framework_input_brkt_top.png) +![bottom](https://crimier.github.io/MyKiCad/Laptop%20mods/framework_input_controller/framework_input_brkt_bottom.png) + ## Changes made in v2: - fixed GND fill between three adjacent GND pins (15-17) of the Input Cover controller