Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
loki077 committed Oct 16, 2024
1 parent f45ecc9 commit cd59b5d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/carbonix_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,24 @@ jobs:
echo "commit_id=$COMMIT_ID" >> $GITHUB_ENV
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
shell: sh -e {0}

- name: Set S3 Path
run: |
DATE_HR=$(date +%Y%m%d_%H%M)
PATH_TO_S3="NA"
if [ "${{ github.event_name }}" = 'release' ]; then
PATH_TO_S3="s3://carbonix-firmware-release-files/Carbopilot_V2/${DATE_HR}_${{ env.firmware_version }}_${{ env.commit_id }}/"
elif [ "${{ github.event_name }}" = 'push' ] && [ "${{ 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 }}/"
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 }}/"
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 "Release to: $PATH_TO_S3"
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 "PUSH : $PATH_TO_S3"
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 "PR : $PATH_TO_S3"
else
PATH_TO_S3="s3://carbonix-firmware-dev-files/Carbopilot_V2/Manual/${DATE_HR}_${{ env.firmware_version }}_${{ env.commit_id }}/"
echo "Manual trigger or other: $PATH_TO_S3"
fi
echo "PATH_TO_S3=$PATH_TO_S3" >> $GITHUB_ENV
shell: sh -e {0}
check_env_variable:
runs-on: ubuntu-latest
Expand Down

0 comments on commit cd59b5d

Please sign in to comment.