Skip to content

Commit

Permalink
Fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronBeneteau committed Dec 2, 2024
1 parent 1fa873f commit 560a277
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

env:
DEFAULT_PROJECT: Demo/Blink
DEFAULT_PLATFORM: 'cli'
DEFAULT_PLATFORM: cli

jobs:
build:
Expand All @@ -24,39 +24,39 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set effective project and platform
- name: Set effective project, platform, and sanitize project name
id: defaults
run: |
echo "Effective project: ${{ github.event.inputs.project || env.DEFAULT_PROJECT }}"
echo "Effective platform: ${{ github.event.inputs.platform || env.DEFAULT_PLATFORM }}"
echo "::set-output name=project::${{ github.event.inputs.project || env.DEFAULT_PROJECT }}"
echo "::set-output name=platform::${{ github.event.inputs.platform || env.DEFAULT_PLATFORM }}"
project_name="${{ github.event.inputs.project || env.DEFAULT_PROJECT }}"
platform="${{ github.event.inputs.platform || env.DEFAULT_PLATFORM }}"
sanitized_project_name=$(echo "$project_name" | sed 's/\//-/g')
- name: Build ${{ steps.defaults.outputs.project }} for ${{ steps.defaults.outputs.platform }}
run: |
cd firmware
make PROJECT=${{ steps.defaults.outputs.project }} PLATFORM=${{ steps.defaults.outputs.platform }} build
echo "Effective project: $project_name"
echo "Sanitized project name: $sanitized_project_name"
echo "Effective platform: $platform"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifact-${{ steps.defaults.outputs.project }}-${{ steps.defaults.outputs.platform }}
path: firmware/build/${{ steps.defaults.outputs.project }}/${{ steps.defaults.outputs.platform }}
echo "::set-output name=project::$project_name"
echo "::set-output name=sanitized_project_name::$sanitized_project_name"
echo "::set-output name=platform::$platform"
deploy:
runs-on: self-hosted
needs: build
environment: deploy
steps:
- name: Sanitize project name
id: sanitize
- name: Build ${{ steps.defaults.outputs.sanitized_project_name }} for ${{ steps.defaults.outputs.platform }}
run: |
sanitized_name="${{ steps.defaults.outputs.project || env.DEFAULT_PROJECT }}"
sanitized_name=$(echo "$project_name" | sed 's/\//-/g')
echo "::set-output name=project_name::$sanitized_name"
cd firmware
make PROJECT=${{ steps.defaults.outputs.sanitized_project_name }} PLATFORM=${{ steps.defaults.outputs.platform }} build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: firmware/build/${{ steps.defaults.outputs.project }}-${{ steps.defaults.outputs.platform }}
name: build-artifact-${{ steps.sanitize.outputs.sanitized_name }}-${{ steps.defaults.outputs.platform }}
name: build-artifact-${{ steps.defaults.outputs.sanitized_project_name }}-${{ steps.defaults.outputs.platform }}
path: firmware/build/${{ steps.defaults.outputs.sanitized_project_name }}/${{ steps.defaults.outputs.platform }}

# deploy:
# runs-on: self-hosted
# needs: build
# environment: deploy
# steps:
# - name: Upload sanitized project artifacts
# uses: actions/upload-artifact@v4
# with:
# path: firmware/build/${{ steps.defaults.outputs.sanitized_project_name }}-${{ steps.defaults.outputs.platform }}
# name: build-artifact-${{ steps.defaults.outputs.sanitized_project_name }}-${{ steps.defaults.outputs.platform }}

0 comments on commit 560a277

Please sign in to comment.