Skip to content

Commit 7244df9

Browse files
authored
Merge pull request #33 from Neotron-Compute/feature/add-rev-to-output-filenames
Feature/add rev to output filenames
2 parents 3343d1a + caa94d0 commit 7244df9

File tree

3 files changed

+85
-13
lines changed

3 files changed

+85
-13
lines changed

.github/workflows/kicad-release.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ jobs:
1414
uses: actions/checkout@v2
1515
with:
1616
submodules: recursive
17-
- name: Set version number # Replace [Uncontrolled] with actual tag
17+
- name: Get Branch Name
18+
id: branch_name
19+
run: |
20+
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
21+
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
22+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
23+
- name: Set version number
1824
env:
19-
GITHUB_REF: ${{ github.ref }}
25+
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
2026
run: |
21-
sed -i "s~\[Uncontrolled\]~${GITHUB_REF/#refs\/tags\/}~g" Kicad/*.sch Kicad/*.kicad_pcb
22-
- name: Build project # This would actually build your project, using zip for an example artifact
27+
sed -i "s~\[Uncontrolled\]~${SOURCE_TAG}~g" Kicad/*.sch Kicad/*.kicad_pcb
28+
- name: Build project
2329
uses: nerdyscout/[email protected]
2430
with:
2531
config: 'Kicad/docs.kibot.yaml'
@@ -33,7 +39,7 @@ jobs:
3339
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3440
with:
3541
tag_name: ${{ github.ref }}
36-
release_name: Release ${{ github.ref }}
42+
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
3743
draft: false
3844
prerelease: false
3945
- name: Build gerbers zip file
@@ -44,9 +50,6 @@ jobs:
4450
with:
4551
files: |
4652
neotron-pico-gerbers.zip
47-
docs/pdfs/*.pdf
48-
docs/ibom/*.html
49-
docs/*.txt
50-
docs/*.csv
53+
docs/*
5154
env:
5255
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/kicad.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
uses: actions/checkout@v2
2323
with:
2424
submodules: recursive
25+
- name: Set version number
26+
env:
27+
GITHUB_SHA: ${{ github.sha }}
28+
run: |
29+
sed -i "s~\[Uncontrolled\]~${GITHUB_SHA:0:6}~g" Kicad/*.sch Kicad/*.kicad_pcb
2530
- name: Run KiBot
2631
uses: nerdyscout/[email protected]
2732
with:

Kicad/docs.kibot.yaml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ preflight:
3131

3232
outputs:
3333
# For more information: https://github.com/INTI-CMNB/KiBoM
34-
- name: 'print schema'
35-
comment: "Print schematic (PDF)"
34+
- name: 'generic Schematic PDF'
35+
comment: "Print the schematic as a PDF"
3636
type: pdf_sch_print
3737
dir: pdfs
3838
options:
@@ -84,22 +84,86 @@ outputs:
8484
type: position
8585
dir: gerbers
8686

87+
- name: 'generate PCB DXF'
88+
comment: "Generate 2D PCB CAD in DXF format"
89+
type: dxf
90+
layers:
91+
- F.Cu
92+
- In1.Cu
93+
- In2.Cu
94+
- B.Cu
95+
- Edge.Cuts
96+
- F.SilkS
97+
- F.Paste
98+
- F.Mask
99+
- B.SilkS
100+
- B.Paste
101+
- B.Mask
102+
options:
103+
output: '%f-pcb-cad-%r.%x'
104+
exclude_edge_layer: false
105+
metric_units: true
106+
107+
- name: 'generate SVG'
108+
comment: "Generate 2D PCB image in SVG format"
109+
type: pcbdraw
110+
options:
111+
output: '%f-pcb-%r.%x'
112+
113+
- name: 'generate PNG'
114+
comment: "Generate 2D PCB image in PNG format"
115+
type: pcbdraw
116+
options:
117+
output: '%f-pcb-%r.%x'
118+
format: png
119+
120+
- name: 'generate 3D model'
121+
comment: "Generate 3D PCB model in STEP format"
122+
type: step
123+
options:
124+
output: '%f-3d-%r.%x'
125+
126+
- name: 'generate PCB PDF'
127+
comment: "Generate 2D PCB CAD in PDF format"
128+
type: pdf_pcb_print
129+
dir: pdfs
130+
layers:
131+
- F.Cu
132+
- In1.Cu
133+
- In2.Cu
134+
- B.Cu
135+
- Edge.Cuts
136+
- F.SilkS
137+
- F.Paste
138+
- F.Mask
139+
- B.SilkS
140+
- B.Paste
141+
- B.Mask
142+
options:
143+
output: '%f-pcb-%r.%x'
144+
separated: true
145+
monochrome: true
146+
87147
- name: 'generate BoM in CSV'
88148
comment: "Generate bill-of-material files"
89149
type: kibom
90150
dir: gerbers
151+
options:
152+
output: '%f-bom-%r.%x'
91153

92154
- name: 'generate BoM in HTML'
93155
comment: "Generate assembly HTML page"
94156
type: ibom
95157
dir: ibom
158+
options:
159+
output: '%f-ibom-%r.%x'
96160

97161
- name: 'jlc position'
98162
comment: "Pick and place file, JLC style"
99163
type: position
100164
options:
101165
variant: rotated
102-
output: '%f_cpl_jlc.%x'
166+
output: '%f-cpl-jlc-%r.%x'
103167
format: CSV
104168
units: millimeters
105169
separate_files_for_front_and_back: false
@@ -122,7 +186,7 @@ outputs:
122186
comment: "BoM for JLC"
123187
type: bom
124188
options:
125-
output: '%f_%i_jlc.%x'
189+
output: '%f-bom-jlc-%r.%x'
126190
exclude_filter: 'only_jlc_parts'
127191
ref_separator: ','
128192
columns:

0 commit comments

Comments
 (0)