diff --git a/.github/workflows/build-user-config.yml b/.github/workflows/build-user-config.yml index 69018294bf32..a0338230f514 100644 --- a/.github/workflows/build-user-config.yml +++ b/.github/workflows/build-user-config.yml @@ -55,6 +55,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Create build directory + run: | + echo "build_dir=$(mktemp -d)" >> $GITHUB_ENV + - name: Prepare variables shell: sh -x {0} env: @@ -98,13 +102,13 @@ jobs: - name: West Build (${{ env.display_name }}) shell: sh -x {0} - run: west build -s zmk/app -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }} + run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }} - name: ${{ env.display_name }} Kconfig file run: | - if [ -f build/zephyr/.config ] + if [ -f "${{ env.build_dir }}/zephyr/.config" ] then - grep -v -e "^#" -e "^$" build/zephyr/.config | sort + grep -v -e "^#" -e "^$" "${{ env.build_dir }}/zephyr/.config" | sort else echo "No Kconfig output" fi @@ -112,12 +116,12 @@ jobs: - name: ${{ env.display_name }} Devicetree file run: | - if [ -f build/zephyr/zephyr.dts ] + if [ -f "${{ env.build_dir }}/zephyr/zephyr.dts" ] then - cat build/zephyr/zephyr.dts - elif [ -f build/zephyr/zephyr.dts.pre ] + cat "${{ env.build_dir }}/zephyr/zephyr.dts" + elif [ -f "${{ env.build_dir }}/zephyr/zephyr.dts.pre" ] then - cat -s build/zephyr/zephyr.dts.pre + cat -s "${{ env.build_dir }}/zephyr/zephyr.dts.pre" else echo "No Devicetree output" fi @@ -126,17 +130,17 @@ jobs: - name: Rename artifacts shell: sh -x {0} run: | - mkdir build/artifacts - if [ -f build/zephyr/zmk.uf2 ] + mkdir "${{ env.build_dir }}/artifacts" + if [ -f "${{ env.build_dir }}/zephyr/zmk.uf2" ] then - cp build/zephyr/zmk.uf2 "build/artifacts/${{ env.artifact_name }}.uf2" - elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ] + cp "${{ env.build_dir }}/zephyr/zmk.uf2" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.uf2" + elif [ -f "${{ env.build_dir }}/zephyr/zmk.${{ inputs.fallback_binary }}" ] then - cp "build/zephyr/zmk.${{ inputs.fallback_binary }}" "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}" + cp "${{ env.build_dir }}/zephyr/zmk.${{ inputs.fallback_binary }}" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}" fi - name: Archive (${{ env.display_name }}) uses: actions/upload-artifact@v3 with: name: ${{ inputs.archive_name }} - path: build/artifacts + path: ${{ env.build_dir }}/artifacts