what could possibly go wrong

This commit is contained in:
rusefillc 2022-05-21 11:38:52 -04:00
parent 50c072c35b
commit 13da98a29c
4 changed files with 42 additions and 4 deletions

View File

@ -1,6 +1,6 @@
name: Check All
on: [push, pull_request]
on: [ push, pull_request ]
jobs:
build-firmware:
@ -18,7 +18,36 @@ jobs:
- name: 2. Copy
run: |
bash step2_copy_with_docker.sh
- name: 3. Create Board
run: |
bash step3_create_board_with_docker.sh
- name: Commit fresh board files
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub create-board Action"
git add boards/*
git status
OUT=$(git commit -am "Auto-generated board" 2>&1) || echo "commit failed, finding out why"
if echo "$OUT" | grep 'nothing to commit'; then
echo "headers: looks like nothing to commit"
echo "::set-env name=NOCOMMIT::true"
exit 0
elif echo "$OUT" | grep 'changed'; then
echo "headers: looks like something has changed"
exit 0
else
echo "headers: looks like something unexpected"
exit 1
fi
- name: Push board files
if: ${{env.NOCOMMIT != 'true'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ steps.extract_branch.outputs.branch }}

3
revision.txt Normal file
View File

@ -0,0 +1,3 @@
# make sure to increment revision BEFORE any changes to content
BOARD_REVISION=d

View File

@ -15,6 +15,9 @@ fi
#
# '/${PWD##*/}' is doing the $pwd basename thing again
docker run --rm -t --user $(id -u):$(id -g) --entrypoint python3 -v "$(pwd)":/${PWD##*/} hellen-one ./bin/copy_from_Kicad.py "frames:alphax_" "/${PWD##*/}" "../../gerber" "2ch" "c"
source revision.txt
echo "BOARD_REVISION=[${BOARD_REVISION}]"
docker run --rm -t --user $(id -u):$(id -g) --entrypoint python3 -v "$(pwd)":/${PWD##*/} hellen-one ./bin/copy_from_Kicad.py "frames:alphax_" "/${PWD##*/}" "../../gerber" "2ch" "${BOARD_REVISION}"
echo "Done!"

View File

@ -7,5 +7,8 @@ fi
# See step2_copy_with_docker.sh for explanation of the following command
docker run --rm -t --user $(id -u):$(id -g) --entrypoint bash -v "$(pwd)":/${PWD##*/} hellen-one ./bin/create_board_with_prefix.sh "alphax_" "/${PWD##*/}" "2ch" "c" "bom_replace_alphax-2ch-c.csv " "0,4"
source revision.txt
echo "BOARD_REVISION=[${BOARD_REVISION}]"
docker run --rm -t --user $(id -u):$(id -g) --entrypoint bash -v "$(pwd)":/${PWD##*/} hellen-one ./bin/create_board_with_prefix.sh "alphax_" "/${PWD##*/}" "2ch" "${BOARD_REVISION}" "bom_replace_alphax-2ch-${BOARD_REVISION}.csv " "0,4"