-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ArendJan/mirte-master
Mirte master & Mirte Pioneer PCBs
- Loading branch information
Showing
154 changed files
with
1,225,983 additions
and
317,764 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
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 |
This file contains 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
Oops, something went wrong.