From 560a277aa8696a04cc7bd52ba063ef8ebb6ce9cf Mon Sep 17 00:00:00 2001 From: Cameron Beneteau Date: Mon, 2 Dec 2024 01:27:24 -0500 Subject: [PATCH] Fix naming --- .github/workflows/build-test-deploy.yml | 54 ++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index 8b3725e6e..1201a542a 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -15,7 +15,7 @@ on: env: DEFAULT_PROJECT: Demo/Blink - DEFAULT_PLATFORM: 'cli' + DEFAULT_PLATFORM: cli jobs: build: @@ -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 }}