LTS - one way of doing things (#4989)
* add lts option * upload logic * proper grouping * proper quoting * it's boolean duh * try toJSON, fix
This commit is contained in:
parent
6361507e72
commit
1ceeb42d93
|
@ -1,7 +1,14 @@
|
||||||
name: Firmware at GHA
|
name: Firmware at GHA
|
||||||
|
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
lts:
|
||||||
|
description: 'LTS Build'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
jobs:
|
jobs:
|
||||||
build-firmware:
|
build-firmware:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -359,7 +366,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||||
run: |
|
run: |
|
||||||
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ]; then
|
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ] || [ "${{toJSON(inputs.lts)}}" = "true" ]; then
|
||||||
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
||||||
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
||||||
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
||||||
|
@ -367,12 +374,12 @@ jobs:
|
||||||
|
|
||||||
# Build rusEFI console
|
# Build rusEFI console
|
||||||
- name: Build console
|
- name: Build console
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
run: bash misc/jenkins/build_java_console.sh
|
run: bash misc/jenkins/build_java_console.sh
|
||||||
|
|
||||||
# Build the simulator
|
# Build the simulator
|
||||||
- name: Build simulator
|
- name: Build simulator
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
# 'OS="Windows_NT"' allows us to build Windows executable on unix
|
# 'OS="Windows_NT"' allows us to build Windows executable on unix
|
||||||
run: OS="Windows_NT" bash misc/jenkins/build_simulator.sh
|
run: OS="Windows_NT" bash misc/jenkins/build_simulator.sh
|
||||||
|
|
||||||
|
@ -382,52 +389,52 @@ jobs:
|
||||||
run: bash misc/jenkins/compile_other_versions/compile.sh ${{matrix.folder}} ${{matrix.build-target}} ${{matrix.ini-file}} ${{matrix.console-settings}}
|
run: bash misc/jenkins/compile_other_versions/compile.sh ${{matrix.folder}} ${{matrix.build-target}} ${{matrix.ini-file}} ${{matrix.console-settings}}
|
||||||
|
|
||||||
- name: Package Bundle
|
- name: Package Bundle
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
run: bash misc/jenkins/compile_other_versions/prepare_bundle.sh ${{matrix.build-target}} ${{matrix.ini-file}}
|
run: bash misc/jenkins/compile_other_versions/prepare_bundle.sh ${{matrix.build-target}} ${{matrix.ini-file}} ${{ toJSON(inputs.lts) }}
|
||||||
|
|
||||||
- name: Upload .ini files
|
- name: Upload .ini files
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
working-directory: ./firmware/tunerstudio/generated
|
working-directory: ./firmware/tunerstudio/generated
|
||||||
run: |
|
run: |
|
||||||
../upload_ini.sh ${{matrix.ini-file}} ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
../upload_ini.sh ${{matrix.ini-file}} ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
||||||
|
|
||||||
- name: Upload build elf
|
- name: Upload build elf
|
||||||
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' && !inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_${{matrix.build-target}}.elf
|
name: rusefi_${{matrix.build-target}}.elf
|
||||||
path: ./firmware/build/rusefi.elf
|
path: ./firmware/build/rusefi.elf
|
||||||
|
|
||||||
- name: Upload build bin
|
- name: Upload build bin
|
||||||
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' && !inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_${{matrix.build-target}}.bin
|
name: rusefi_${{matrix.build-target}}.bin
|
||||||
path: ./firmware/deliver/rusefi*.bin
|
path: ./firmware/deliver/rusefi*.bin
|
||||||
|
|
||||||
- name: Upload build hex
|
- name: Upload build hex
|
||||||
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' && !inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_${{matrix.build-target}}.hex
|
name: rusefi_${{matrix.build-target}}.hex
|
||||||
path: ./firmware/deliver/rusefi*.hex
|
path: ./firmware/deliver/rusefi*.hex
|
||||||
|
|
||||||
- name: Upload build dfu
|
- name: Upload build dfu
|
||||||
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' && env.skip != 'true' && !inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_${{matrix.build-target}}.dfu
|
name: rusefi_${{matrix.build-target}}.dfu
|
||||||
path: ./firmware/deliver/rusefi*.dfu
|
path: ./firmware/deliver/rusefi*.dfu
|
||||||
|
|
||||||
- name: Upload bundle
|
- name: Upload bundle
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_bundle_${{matrix.build-target}}.zip
|
name: rusefi_bundle_${{matrix.build-target}}.zip
|
||||||
path: ./artifacts/rusefi_bundle*.zip
|
path: ./artifacts/rusefi_bundle*.zip
|
||||||
|
|
||||||
- name: Upload autoupdate bundle
|
- name: Upload autoupdate bundle
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_bundle_${{matrix.build-target}}_autoupdate.zip
|
name: rusefi_bundle_${{matrix.build-target}}_autoupdate.zip
|
||||||
|
@ -479,7 +486,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
||||||
run: |
|
run: |
|
||||||
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ]; then
|
if [ "${{github.event_name}}" = "push" ] && [ "${{github.ref}}" = "refs/heads/master" ] || [ "${{toJSON(inputs.lts)}}" = "true" ]; then
|
||||||
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
echo "::set-env name=RUSEFI_SSH_SERVER::${{secrets.RUSEFI_SSH_SERVER}}";
|
||||||
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
echo "::set-env name=RUSEFI_SSH_USER::${{secrets.RUSEFI_SSH_USER}}";
|
||||||
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
echo "::set-env name=RUSEFI_SSH_PASS::${{secrets.RUSEFI_SSH_PASS}}";
|
||||||
|
@ -490,8 +497,8 @@ jobs:
|
||||||
run: OS="Windows_NT" bash misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh
|
run: OS="Windows_NT" bash misc/jenkins/functional_test_and_build_bundle/build_current_bundle.sh
|
||||||
|
|
||||||
- name: Package Bundle
|
- name: Package Bundle
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || inputs.lts }}
|
||||||
run: bash misc/jenkins/compile_other_versions/prepare_bundle.sh default
|
run: bash misc/jenkins/compile_other_versions/prepare_bundle.sh default default ${{ toJSON(inputs.lts) }}
|
||||||
|
|
||||||
- name: Attach console junit results
|
- name: Attach console junit results
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -501,13 +508,13 @@ jobs:
|
||||||
path: ./java_console/build/*.txt
|
path: ./java_console/build/*.txt
|
||||||
|
|
||||||
- name: Upload 'all' .ini files
|
- name: Upload 'all' .ini files
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' && env.skip != 'true' ) || inputs.lts }}
|
||||||
working-directory: ./firmware/tunerstudio/generated
|
working-directory: ./firmware/tunerstudio/generated
|
||||||
run: |
|
run: |
|
||||||
../upload_ini.sh rusefi.ini ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
../upload_ini.sh rusefi.ini ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
|
||||||
|
|
||||||
- name: Upload primary bundle
|
- name: Upload primary bundle
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
if: ${{( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || inputs.lts }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rusefi_bundle.zip
|
name: rusefi_bundle.zip
|
||||||
|
|
|
@ -115,8 +115,14 @@ ls -l $FULL_BUNDLE_FILE
|
||||||
|
|
||||||
if [ -n "$RUSEFI_SSH_USER" ]; then
|
if [ -n "$RUSEFI_SSH_USER" ]; then
|
||||||
echo "$SCRIPT_NAME: Uploading full bundle"
|
echo "$SCRIPT_NAME: Uploading full bundle"
|
||||||
|
retVal=0
|
||||||
|
if [ "$1" = "true" ]; then
|
||||||
|
tar -czf - $FULL_BUNDLE_FILE | sshpass -p $RUSEFI_SSH_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_SSH_USER@$RUSEFI_SSH_SERVER "tar -xzf - -C build_server/lts"
|
||||||
|
retVal=$?
|
||||||
|
else
|
||||||
tar -czf - $FULL_BUNDLE_FILE | sshpass -p $RUSEFI_SSH_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_SSH_USER@$RUSEFI_SSH_SERVER "tar -xzf - -C build_server"
|
tar -czf - $FULL_BUNDLE_FILE | sshpass -p $RUSEFI_SSH_PASS ssh -o StrictHostKeyChecking=no $RUSEFI_SSH_USER@$RUSEFI_SSH_SERVER "tar -xzf - -C build_server"
|
||||||
retVal=$?
|
retVal=$?
|
||||||
|
fi
|
||||||
if [ $retVal -ne 0 ]; then
|
if [ $retVal -ne 0 ]; then
|
||||||
echo "full bundle upload failed"
|
echo "full bundle upload failed"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -12,7 +12,7 @@ export FOLDER="temp/snapshot_${TIMESTAMP}_${BUNDLE_NAME}_rusefi"
|
||||||
|
|
||||||
export BUNDLE_FULL_NAME="rusefi_bundle_${BUNDLE_NAME}"
|
export BUNDLE_FULL_NAME="rusefi_bundle_${BUNDLE_NAME}"
|
||||||
|
|
||||||
bash misc/jenkins/build_working_folder.sh
|
bash misc/jenkins/build_working_folder.sh "$3"
|
||||||
|
|
||||||
pwd
|
pwd
|
||||||
echo "exiting $SCRIPT_NAME"
|
echo "exiting $SCRIPT_NAME"
|
||||||
|
|
Loading…
Reference in New Issue