2020-06-18 15:31:54 -07:00
|
|
|
name: Generate configs and live docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-06-18 16:12:58 -07:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2020-06-28 18:16:14 -07:00
|
|
|
- name: Install Tools
|
|
|
|
run: sudo apt-get install ncftp sshpass
|
|
|
|
|
2020-07-30 09:27:20 -07:00
|
|
|
- name: Generate Enum Strings
|
|
|
|
working-directory: ./firmware/
|
|
|
|
run: bash gen_enum_to_string.sh
|
|
|
|
|
2020-06-18 15:31:54 -07:00
|
|
|
- name: Generate Configs
|
|
|
|
working-directory: ./firmware/
|
2020-07-14 07:28:26 -07:00
|
|
|
run: bash gen_config.sh
|
2020-06-18 15:31:54 -07:00
|
|
|
|
2020-06-28 18:16:14 -07:00
|
|
|
- name: Upload .ini files
|
2020-07-07 18:48:05 -07:00
|
|
|
working-directory: ./firmware/tunerstudio/generated
|
2020-06-28 18:16:14 -07:00
|
|
|
# run: ./upload.sh ${{ secrets.RUSEFI_DOXYGEN_FTP_USER }} ${{ secrets.RUSEFI_DOXYGEN_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
2020-07-07 18:54:43 -07:00
|
|
|
run: ../upload_ini.sh ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
2020-06-28 18:16:14 -07:00
|
|
|
|
2020-06-18 15:31:54 -07:00
|
|
|
- name: Generate Live Documentation
|
|
|
|
working-directory: ./firmware/
|
2020-07-14 07:28:26 -07:00
|
|
|
run: bash gen_live_documentation.sh
|
2020-06-18 15:31:54 -07:00
|
|
|
|
|
|
|
# Commit changes and catch the error that occurs if nothing has been changed (without catching other errors)
|
|
|
|
- name: Commit changes
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub build-firmware Action"
|
2020-06-28 18:25:09 -07:00
|
|
|
git status
|
2020-07-19 14:50:22 -07:00
|
|
|
OUT=$(git commit -am "Auto-generated configs and docs" 2>&1) || echo "commit failed, finding out why"
|
|
|
|
if echo "$OUT" | grep 'nothing to commit'; then
|
2020-11-18 15:44:53 -08:00
|
|
|
echo "::set-env name=NOCOMMIT::true"
|
2020-07-19 14:50:22 -07:00
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-06-18 15:31:54 -07:00
|
|
|
|
|
|
|
# We need to know what branch this is in order to push to the correct branch
|
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
|
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
|
|
id: extract_branch
|
|
|
|
|
|
|
|
- name: Push configs
|
2020-07-21 11:34:11 -07:00
|
|
|
if: ${{env.NOCOMMIT != 'true'}}
|
2020-06-18 15:31:54 -07:00
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ github.token }}
|
|
|
|
branch: ${{ steps.extract_branch.outputs.branch }}
|