automation

This commit is contained in:
rusefi 2023-08-01 22:19:34 -04:00
parent 30522a05eb
commit 5db222f538
1 changed files with 65 additions and 0 deletions

65
.github/workflows/create-board.yaml vendored Normal file
View File

@ -0,0 +1,65 @@
name: Create Board
on:
workflow_call:
inputs:
token:
description: 'Token for accessing private repos'
required: false
type: string
jobs:
create-board:
runs-on: ubuntu-latest
steps:
- name: Set Token
run: |
if ! [[ -z "${{ inputs.token }}" ]]; then
echo "TOKEN=${{ inputs.token }}" >> "$GITHUB_ENV"
else
echo "TOKEN=${{ github.token }}" >> "$GITHUB_ENV"
fi
- uses: actions/checkout@v3
with:
token: ${{ env.TOKEN }}
submodules: recursive
- name: Install kicad
run: |
sudo add-apt-repository --yes ppa:kicad/kicad-7.0-releases
sudo apt-get install kicad
pip install kicad-netlist-reader
- name: Generate Gerber Files
working-directory: stim
run: |
bash ../hellen-one/kicad/bin/export.sh
- name: 1. Build Docker
run: |
bash hellen-one/bin/step1_build_hellen-one_docker.sh
# - name: 2. Copy
# run: |
# bash hellen-one/bin/step2_copy_with_docker.sh
# - name: 3. Create Board
# run: |
# bash hellen-one/bin/step3_create_board_with_docker.sh
- name: Commit fresh board files
working-directory: stim
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
bash hellen-one/bin/gha-commit.sh
- name: Push board files
# let's support both newer 'main' and older 'master' repositories
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && env.NOCOMMIT != 'true'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ steps.extract_branch.outputs.branch }}