Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sw 199 ci to upload firmware to s 3 bucket #141

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 53 additions & 14 deletions .github/workflows/carbonix_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ on:
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'

release:
types: [published]

workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -168,21 +171,21 @@ jobs:
run: |
. .github/workflows/ccache.env

- name: build Carbonix Flight Controller
shell: bash
run: |
boards=("CubeOrange" "CarbonixCubeOrange" "sitl")
for board in "${boards[@]}"; do
echo "Compiling AP_Periph for $board..."
./Tools/scripts/build_bootloaders.py "$board"
./waf configure --board "$board" --define=CARBOPILOT=1
./waf plane
done
echo "Script completed successfully."
# - name: build Carbonix Flight Controller
# shell: bash
# run: |
# boards=("CubeOrange")
# for board in "${boards[@]}"; do
# echo "Compiling AP_Periph for $board..."
# ./Tools/scripts/build_bootloaders.py "$board"
# ./waf configure --board "$board" --define=CARBOPILOT=1
# ./waf plane
# done
# echo "Script completed successfully."
- name: build Carbonix Periph boards
shell: bash
run: |
boards=("CarbonixF405" "Volanti-M1" "Volanti-M2" "Volanti-M3" "Volanti-M4" "Volanti-M5" "Volanti-LWing" "Volanti-RWing" "Volanti-LTail" "Volanti-RTail" "Ottano-M1" "Ottano-M2" "Ottano-M3" "Ottano-M4" "Ottano-M5" "Ottano-LWing" "Ottano-RWing" "Ottano-LTail" "Ottano-RTail")
boards=("CarbonixF405")
for board in "${boards[@]}"; do
echo "Compiling AP_Periph for $board..."
./Tools/scripts/build_bootloaders.py "$board"
Expand All @@ -194,7 +197,7 @@ jobs:
id: check_files
uses: andstor/file-existence-action@v2
with:
files: "build/CubeOrange/*, build/CarbonixCubeOrange/*, build/sitl/*, build/CarbonixF405/*, build/Volanti-M1/*, build/Volanti-M2/*, build/Volanti-M3/*, build/Volanti-M4/*, build/Volanti-M5/*, build/Volanti-LWing/*, build/Volanti-RWing/*, build/Volanti-LTail/*, build/Volanti-RTail/*, build/Ottano-M1/*, build/Ottano-M2/*, build/Ottano-M3/*, build/Ottano-M4/*, build/Ottano-M5/*, build/Ottano-LWing/*, build/Ottano-RWing/*, build/Ottano-LTail/*, build/Ottano-RTail/*"
files: "build/CarbonixF405/*"
fail: true
- name: Extract firmware version and commit id
id: extract_info
Expand All @@ -207,7 +210,7 @@ jobs:
- name: Gather build output
run: |
mkdir -p temp
for dir in CubeOrange CarbonixCubeOrange sitl CarbonixF405 Volanti-M1 Volanti-M2 Volanti-M3 Volanti-M4 Volanti-M5 Volanti-LWing Volanti-RWing Volanti-LTail Volanti-RTail Ottano-M1 Ottano-M2 Ottano-M3 Ottano-M4 Ottano-M5 Ottano-LWing Ottano-RWing Ottano-LTail Ottano-RTail; do
for dir in CarbonixF405; do
mkdir -p temp/$dir/bin
cp -v build/$dir/bin/* temp/$dir/bin/
done
Expand All @@ -219,3 +222,39 @@ jobs:
name: ${{ env.firmware_version }}_${{ env.commit_id }}
path: temp
retention-days: 90

- name: Install AWS CLI
run: |
sudo apt-get update
sudo apt-get install -y curl unzip
curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Set BRANCH_NAME
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV

- name: Upload artifacts to S3
run: |
DATE_HR=$(date +%Y%m%d_%H%M)
if [[ "${{ github.event_name }}" == "release" ]]; then
PATH_TO_S3=s3://carbonix-firmware-release-files/Carbopilot_V2/${DATE_HR}_${{ env.firmware_version }}_${{ env.commit_id }}/
echo "Uploading to: $PATH_TO_S3"
aws s3 cp temp/ $PATH_TO_S3 --recursive
elif ${{ github.event_name == 'push' && startsWith(env.BRANCH_NAME, 'CxPilot') }}; then
PATH_TO_S3=s3://carbonix-firmware-dev-files/Carbopilot_V2/${{ env.BRANCH_NAME }}/${DATE_HR}_${{ env.firmware_version }}_${{ env.commit_id }}/
echo "Uploading to: $PATH_TO_S3"
aws s3 cp temp/ $PATH_TO_S3 --recursive
elif ${{ github.event_name == 'pull_request' }}; then
PATH_TO_S3=s3://carbonix-firmware-dev-files/Carbopilot_V2/PR/${DATE_HR}_${{ env.firmware_version }}_${{ env.commit_id }}_${{ github.event.pull_request.number }}/
echo "Uploading to: $PATH_TO_S3"
aws s3 cp temp/ $PATH_TO_S3 --recursive
fi

128 changes: 0 additions & 128 deletions .github/workflows/cx_build_compare.yml

This file was deleted.

Loading
Loading