2023-12-01 20:46:13 -08:00
|
|
|
#
|
|
|
|
# see https://github.com/rusefi/fw-Paralela/blob/master/.github/workflows/compile-board.yaml as an example of how to build custom board firmware
|
|
|
|
#
|
|
|
|
|
|
|
|
name: Build Custom Board Firmware
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
shortBoardName:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
create-board:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Echo
|
|
|
|
run: |
|
2023-12-20 08:08:46 -08:00
|
|
|
echo "shortBoardName=${{inputs.shortBoardName}}"
|
2023-12-01 20:46:13 -08:00
|
|
|
|
2023-12-20 07:45:25 -08:00
|
|
|
- name: Set Env Variables
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
run: |
|
|
|
|
echo "META_OUTPUT_ROOT_FOLDER=../../../generated/" >> $GITHUB_ENV
|
|
|
|
echo "gha_shortBoardName=${{inputs.shortBoardName}}" >> $GITHUB_ENV
|
|
|
|
echo "gha_iniFileName=rusefi_${{inputs.shortBoardName}}.ini" >> $GITHUB_ENV
|
|
|
|
|
2023-12-04 00:46:27 -08:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-01 20:46:13 -08:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
# Build machines don't have arm-none-eabi gcc, so let's download it and put it on the path
|
|
|
|
- name: Download & Install GCC
|
|
|
|
if: ${{ env.skip != 'true' }}
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
run: |
|
|
|
|
ext/rusefi/firmware/provide_gcc.sh
|
|
|
|
echo "::add-path::`pwd`/gcc-arm-none-eabi/bin"
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '11'
|
|
|
|
|
|
|
|
- name: Test Compiler
|
|
|
|
run: javac -version
|
|
|
|
|
|
|
|
- name: Install Tools
|
|
|
|
run: |
|
|
|
|
sudo bash ext/rusefi/misc/actions/add-ubuntu-latest-apt-mirrors.sh
|
|
|
|
sudo apt-get install sshpass sshpass mtools
|
|
|
|
|
|
|
|
- name: Gen Config
|
|
|
|
working-directory: ext/rusefi/firmware
|
|
|
|
run: |
|
2023-12-20 07:45:25 -08:00
|
|
|
bash gen_config_board.sh ../../.. ${{env.gha_shortBoardName}}
|
2023-12-01 20:46:13 -08:00
|
|
|
|
2023-12-20 06:59:25 -08:00
|
|
|
- name: Repo Status
|
|
|
|
run: |
|
|
|
|
git status
|
|
|
|
|
|
|
|
- name: ext/rusefi Status
|
2023-12-01 20:46:13 -08:00
|
|
|
working-directory: ext/rusefi
|
|
|
|
run: |
|
|
|
|
git status
|
|
|
|
|
2023-12-20 06:59:25 -08:00
|
|
|
- name: Push Config
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub git update Action"
|
|
|
|
git add generated/*
|
|
|
|
OUT=$(git commit -am "GHA Automation" 2>&1) || echo "commit failed, finding out why"
|
|
|
|
if echo "$OUT" | grep 'nothing to commit'; then
|
|
|
|
echo "Configs: looks like nothing to commit"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
git status
|
2023-12-01 21:30:20 -08:00
|
|
|
|
2023-12-03 10:31:28 -08:00
|
|
|
- name: Connectors Status
|
|
|
|
run: |
|
|
|
|
git status
|
|
|
|
|
|
|
|
- name: Push Connectors
|
|
|
|
run: |
|
2023-12-15 13:42:36 -08:00
|
|
|
if [ -d connectors ]; then
|
|
|
|
git add connectors/*
|
|
|
|
fi
|
2023-12-04 07:15:00 -08:00
|
|
|
OUT=$(git commit -am "GHA Connectors Generated" 2>&1) || echo "commit failed, finding out why"
|
|
|
|
if echo "$OUT" | grep 'nothing to commit'; then
|
|
|
|
echo "Connectors: looks like nothing to commit"
|
|
|
|
exit 0
|
|
|
|
fi
|
2023-12-04 07:21:07 -08:00
|
|
|
echo "[$OUT]"
|
2023-12-03 10:31:28 -08:00
|
|
|
|
|
|
|
- name: Push
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ github.token }}
|
|
|
|
|
2023-12-01 20:46:13 -08:00
|
|
|
- name: Upload .ini files to server
|
2023-12-20 08:08:46 -08:00
|
|
|
working-directory: generated/tunerstudio/generated
|
|
|
|
run: ../../../ext/rusefi/firmware/tunerstudio/upload_ini.sh ${{env.gha_iniFileName}} ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
2023-12-01 20:46:13 -08:00
|
|
|
|
|
|
|
- name: Build Firmware
|
|
|
|
working-directory: ext/rusefi
|
2023-12-20 07:45:25 -08:00
|
|
|
run: bash misc/jenkins/compile_other_versions/compile.sh ../../.. ${{env.gha_shortBoardName}}
|
2023-12-01 20:46:13 -08:00
|
|
|
|
|
|
|
- name: Upload build bin artifact
|
2023-12-15 00:37:05 -08:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-12-01 20:46:13 -08:00
|
|
|
with:
|
|
|
|
name: rusefi.bin
|
|
|
|
path: ext/rusefi/firmware/deliver/rusefi*.bin
|
|
|
|
|
|
|
|
- name: Upload build hex artifact
|
2023-12-15 00:37:05 -08:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-12-01 20:46:13 -08:00
|
|
|
with:
|
|
|
|
name: rusefi.hex
|
|
|
|
path: ext/rusefi/firmware/deliver/rusefi*.hex
|
|
|
|
|
|
|
|
- name: Upload build map artifact
|
2023-12-15 00:37:05 -08:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-12-01 20:46:13 -08:00
|
|
|
with:
|
|
|
|
name: rusefi.map
|
|
|
|
path: ext/rusefi/firmware/deliver/rusefi*.map
|
|
|
|
|
|
|
|
- name: Build console
|
|
|
|
working-directory: ext/rusefi/
|
|
|
|
run: bash misc/jenkins/build_java_console.sh
|
|
|
|
|
|
|
|
- name: Set SSH variables
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
run: |
|
|
|
|
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ]; then
|
|
|
|
echo "Setting credentials..."
|
|
|
|
echo "RUSEFI_SSH_SERVER=${{secrets.RUSEFI_SSH_SERVER}}" >> $GITHUB_ENV
|
|
|
|
echo "RUSEFI_SSH_USER=${{secrets.RUSEFI_SSH_USER}}" >> $GITHUB_ENV
|
|
|
|
echo "RUSEFI_SSH_PASS=${{secrets.RUSEFI_SSH_PASS}}" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "NOT setting credentials: ${{github.event_name}} ${{github.ref}}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Package and Upload Bundle
|
|
|
|
working-directory: ext/rusefi/
|
2023-12-20 16:58:12 -08:00
|
|
|
run: bash misc/jenkins/compile_other_versions/prepare_bundle.sh ${{env.gha_shortBoardName}} "../../generated/tunerstudio/generated/${{env.gha_iniFileName}}" master
|
2023-12-01 20:46:13 -08:00
|
|
|
|
|
|
|
- name: Upload bundle artifact
|
2023-12-15 00:37:05 -08:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-12-01 20:46:13 -08:00
|
|
|
with:
|
2023-12-20 07:45:25 -08:00
|
|
|
name: rusefi_bundle_${{env.gha_shortBoardName}}.zip
|
2023-12-01 20:46:13 -08:00
|
|
|
path: ext/rusefi/artifacts/rusefi_bundle*.zip
|