Add ki cost #23
Workflow file for this run
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
name: Production | |
on: | |
workflow_dispatch: | |
pull_request_target: | |
types: | |
- closed | |
jobs: | |
generate: | |
name: Generate production data | |
runs-on: ubuntu-latest | |
container: ghcr.io/inti-cmnb/kicad8_auto_full:latest | |
env: | |
MOUSER_KEY: ${{ secrets.MOUSER_KEY }} | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
device_type: [Watch, Sensor] | |
include: | |
- device_type: Watch | |
NewImage: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: . | |
submodules: recursive | |
- name: Cache KiCost data | |
uses: actions/cache@v3 | |
with: | |
path: ~/kicost_cache | |
key: kicost_cache | |
- name: Extract branch name | |
shell: bash | |
run: | | |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
- name: Initialize | |
run: | | |
mkdir -p log | |
mkdir -p docs/images/ | |
mkdir -p production | |
- name: Generate files | |
run: | | |
cd project | |
kibot -vvvv -g variant=${{ matrix.device_type }} -d ../production/${{ matrix.device_type }} 2> ../log/kibot.log | |
mkdir ../production/${{ matrix.device_type }}/ordering | |
mv ../production/PCBWay ../production/${{ matrix.device_type }}/ordering/PCBWay | |
- name: Clean up | |
run: | | |
cd production/${{ matrix.device_type }} | |
find . -type f -iname \*.log -delete | |
find . -type f -iname \*.ogv -delete | |
- name: Upload logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: Log-${{ matrix.device_type }} | |
path: log | |
- name: Upload Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.device_type }} | |
path: production | |
if-no-files-found: ignore | |
- if: ${{ matrix.NewImage && (github.event.pull_request.merged == true) }} | |
name: Update image | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
cp production/${{ matrix.device_type }}/docs/images/PCB_Rendering.png docs/images/Image_Complete.png | |
git add docs/images/Image_Complete.png | |
git commit -m "Add image from CI/CD action" | |
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
echo https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git push origin ${{ github.base_ref }} |