-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 2.68 KB
/
hardware_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Hardware Workflow
on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
paths:
- "Hardware/**"
- "Docs/**"
permissions: write-all
jobs:
KiCad_Hardware:
runs-on: ubuntu-latest
name: KiCad Hardware
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: INTI-CMNB/KiBot@v2_k7
with:
# Config file
config: Hardware/config.kibot.yaml
# Prefix for output in config file.
dir: _hardwareOutput
# Hardware Files
schema: "Hardware/SegmentTestBoard/SegmentTestBoard.kicad_sch"
board: "Hardware/SegmentTestBoard/SegmentTestBoard.kicad_pcb"
- name: upload results
uses: actions/upload-artifact@v2
with:
name: Board-Hardware
path: _hardwareOutput
- name: Discord notification if failed
if: ${{ failure() }}
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
args: "Building new board failed, most likely a DRC check."
dev-publish:
# publish only to devs
runs-on: ubuntu-latest
name: Dev-Publish
needs: [KiCad_Hardware]
steps:
# Download artifacts
- uses: actions/download-artifact@v2
with:
name: Board-Hardware
- name: send custom message with args
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
file: "SegmentTestBoard-3D_top.png"
publish:
# Only run on tags
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
name: Publish
needs: [KiCad_Hardware]
steps:
# Be in our repo
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Download artifacts
- uses: actions/download-artifact@v2
with:
name: Board-Hardware
- run: mkdir -p _staging/
- run: cp *.pdf _staging/
- run: cp *.step _staging/
# Copy gerbers
- run: cp PCBWay/*.zip _staging/Board-$(git rev-parse --short HEAD)-PCBWay.zip
- run: cp JLCPCB/*.zip _staging/Board-$(git rev-parse --short HEAD)-JLCPCB.zip
- name: Upload Docs to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "_staging/*"
tag: ${{ github.ref }}
overwrite: true
prerelease: true
body: "Kitsune Scientific, Automated with github ci/cd."
file_glob: true