Skip to content

Commit

Permalink
Migration to 7.0 and github action
Browse files Browse the repository at this point in the history
release path of workflow

two workflows

nousbpd variant

clean workflows
  • Loading branch information
tuna-f1sh committed Mar 9, 2023
1 parent 43a1f17 commit 8009481
Show file tree
Hide file tree
Showing 15 changed files with 39,203 additions and 11,685 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build distributable and production files

env:
PROJECT_NAME: entree
MAKE_DEFAULT: false
MAKE_PDF: true
MAKE_PROD: false

on:
workflow_dispatch:
push:
tags: r**

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/tuna-f1sh/kicad-makefile:latest
# mount the workspace path to container workdir /project so accessible by all steps
volumes:
- ${{ github.workspace }}:/project

steps:
- uses: actions/checkout@v3

- name: Prepare
# https://github.com/actions/runner/issues/2033
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Run make
if: ${{ env.MAKE_DEFAULT }}
run: make

- name: Run make pdf
if: ${{ env.MAKE_PDF }}
run: make pdf

- name: Run make prod-
if: ${{ env.MAKE_PROD }}
run: |
make prod-gerbers
make prod-bom
make prod-pos
- name: Upload outputs
uses: actions/upload-artifact@v3
with:
name: kicad-makefile-output
path: output

release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- name: Download outputs
uses: actions/download-artifact@v3
with:
name: kicad-makefile-output
path: output

- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: false
files: |
outout/*.pdf
outout/**/*.zip
45 changes: 45 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Make SCH and PCB review pdf

env:
PROJECT_NAME: entree

on:
push:
branches: [ main ]
paths:
- '**.kicad_sch'
- '**.kicad_pcb'
- 'Makefile'
- '.github/workflows/build.yml'
pull_request:
branches: [ main ]
paths:
- '**.kicad_sch'
- '**.kicad_pcb'
- 'Makefile'
- '.github/workflows/build.yml'

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/tuna-f1sh/kicad-makefile:latest
# mount the workspace path to container workdir /project so accessible by all steps
volumes:
- ${{ github.workspace }}:/project

steps:
- uses: actions/checkout@v3

- name: Prepare
# https://github.com/actions/runner/issues/2033
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Run make pdf
run: make pdf

- name: Upload outputs
uses: actions/upload-artifact@v3
with:
name: ${{ env.PROJECT_NAME }}-review-pdf
path: output/*.pdf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
output/
exports/
ref/
.vagrant
Expand Down
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Must be name of the .kicad_pro, .kicad_pcb and root .kicad_sch
PROJECT_NAME = entree
# Directory containing PROJECT_NAME.kicad_* files
PROJECT_ROOT = .

# Can be a string or number indicating release revision
# REVISION = 0
# Define and set to 1 to limit info output
# KICADMK_QUIET = 1
# Define and set to 1 to append git describe tag and hash to export zips
KICADMK_APPEND_GIT ?= 1
# Define and set to 0 to not generate log of variables to include in exports
# KICADMK_INCLUDE_LOG = 1
# Define and set to 1 to print the log content at start to shell
# KICADMK_PRINT_LOG = 0

# Define a command that generates a BoM - kibom installed with pip by default but could be path to Python script
BOM_CMD ?= kibom
# KiBoM by default creates output with _bom_REV.csv appended, pass a config file to it to match target BoM name
BOM_CMD_FLAGS = --cfg $(PROJECT_ROOT)/bom.ini
ifneq ($(VARIANT),)
BOM_CMD_FLAGS += --variant $(VARIANT)
BOM_FILENAME = $(PROJECT_NAME)-$(VARIANT).csv
endif

# Location of KiCad Makefile repository if not defined in environment, eg: export KICADMK_DIR=/home/me/kicad-makefile
# KICADMK_DIR = ./kicad-makefile

# Optionally include a supplier Makefile to define flags used by that supplier
include $(KICADMK_DIR)/suppliers/PCBWay.mk

# Include the KiCad Makefile
include $(KICADMK_DIR)/Kicad.mk

nousbpd:
$(MAKE) VARIANT=nousbpd
4 changes: 2 additions & 2 deletions bom.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ test_regex = 1
; If 'merge_blank_fields' option is set to 1, component groups with blank fields will be merged into the most compatible group, where possible
merge_blank_fields = 1
; Specify output file name format, %O is the defined output name, %v is the version, %V is the variant name which will be ammended according to 'variant_file_name_format'.
output_file_name = %O_bom_%v%V
output_file_name = %O
; Specify the variant file name format, this is a unique field as the variant is not always used/specified. When it is unused you will want to strip all of this.
variant_file_name_format = _(%V)
variant_file_name_format = _%V
; Field name used to determine if a particular part is to be fitted
fit_field = Config
; Make a backup of the bom before generating the new one, using the following template
Expand Down
Binary file removed entree-r0.pdf
Binary file not shown.
Loading

0 comments on commit 8009481

Please sign in to comment.