Skip to content

Commit

Permalink
Merge pull request #4 from ArendJan/mirte-master
Browse files Browse the repository at this point in the history
Mirte master & Mirte Pioneer PCBs
  • Loading branch information
mklomp authored Sep 20, 2024
2 parents 3e18f3d + 55664c3 commit 93a985a
Show file tree
Hide file tree
Showing 154 changed files with 1,225,983 additions and 317,764 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/artifactComment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# pr-comment-artifact-url.yml
---
name: Comment Artifact URL on PR

on:
workflow_run:
types:
- "completed"
workflows:
- "kibot"

jobs:
comment-on-pr:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:

- name: Get Artifact URL & PR Info
env:
GITHUB_TOKEN: ${{ github.token }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
run: |
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Job ID: $PREVIOUS_JOB_ID"
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
ARTIFACT_URL=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.archive_download_url")
echo "ARTIFACT URL: $ARTIFACT_URL"
echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_ENV"
PR_NUMBER=$(jq -r '.pull_requests[0].number' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "PR Number: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Head sha: $HEAD_SHA"
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
- name: Update Comment
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/\
runs/${{ env.PREVIOUS_JOB_ID }}"
HEAD_SHA: ${{ env.HEAD_SHA }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ env.PR_NUMBER }}
body: |-
## KiBot output
[![badge]]($JOB_PATH)
You can find files attached to the below linked Workflow Run URL (Logs).
Please note that files only stay for around 90 days!
| Name | Link
--------------------------------------------------------------------
| Commit | ${{ env.HEAD_SHA }}
| Logs | ${{ env.JOB_PATH }}
| Download | ${{ env. ARTIFACT_URL }}
[badge]: https://img.shields.io/badge/Build-Success!-3fb950?logo=github&style=for-the-badge
66 changes: 66 additions & 0 deletions .github/workflows/kibot2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: kibot

on: [push]

jobs:

kicad_generate_and_upload:
permissions:
# Required to upload/save artifact, otherwise you'll get
# "Error: Resource not accessible by integration"
contents: write
# Required to post comment, otherwise you'll get
# "Error: Resource not accessible by integration"
pull-requests: write

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [mirte-master, mirte-pioneer, mirte-master-bottom]
environment: kibot
# defaults:
# run:
# working-directory: mirte-master

steps:
# - run: ls
# - run: cd mirte-master
- if: matrix.project == 'mirte-pioneer'
run: |
echo "SCH_NAME=mirte_combination" >> $GITHUB_ENV
- if: matrix.project != 'mirte-pioneer'
run: |
echo "SCH_NAME=${{ matrix.project }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: INTI-CMNB/KiBot@v2_k8
with:
# Required - kibot config file
config: ${{ matrix.project }}/kibot_generated.kibot.yaml
# optional - prefix to output defined in config
dir: output
# optional - schematic file
schema: '${{ matrix.project }}/${{ env.SCH_NAME }}.kicad_sch'
# optional - PCB design file
board: '${{ matrix.project }}/${{ env.SCH_NAME }}.kicad_pcb'
install3D: true
- run: tree output
- name: upload results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-output
path: output
- name: upload step
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-step
path: output/3D/${{ env.SCH_NAME }}-3D.step

- name: Push to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
output/3D/${{ env.SCH_NAME }}-3D.step
output/PCB/PDF/${{ env.SCH_NAME }}-assembly.pdf
output/Schematic/${{ env.SCH_NAME }}-schematic.pdf
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fp-info-cache
# Exported BOM files
*.xml
*.csv
!rotations.csv
export-*

# Rendered output
Expand All @@ -36,3 +37,16 @@ gerber/
.kidiff/
mirte_combination.kicad_pcb.zip
bom/*

*.kicad_prl
mirte-master/#auto_saved_files#
*.lck
svg/
.cache/
Generated/
production/
*/jlcpcb/*
mirte-master/mirte-master.step
mirte-master-bottom/mirte-master-bottom.step
!*/jlcpcb/project.db
mirte-pioneer/jlcpcb/production_files/GERBER-mirte_combination.zip
Loading

0 comments on commit 93a985a

Please sign in to comment.