diff --git a/.github/workflows/firmware_build.yml b/.github/workflows/firmware_build.yml index 19982a7e46..b8cb86b522 100755 --- a/.github/workflows/firmware_build.yml +++ b/.github/workflows/firmware_build.yml @@ -58,13 +58,26 @@ jobs: esac done + - name: Prepare keyboard name for Artifacts + id: prep_artifact_name + run: | + # Calculate a unique string which applies to the matrix entry + # that we can use to construct unique and valid artifact names. + # We achieve that by squashing runs of characters are invalid + # in artifact names, and also whitespace and dashes, into a + # single dash character. The unique string will appear as + # the environment variable ARTIFACT_NAME in subsequent actions. + name="${{ matrix.keyboard }}" + # The option to enable + in sed regexps differs by OS so we avoid it + name=$(echo -n "$name" | sed -e 's/[ \t:\/\\"<>|*?]/_/g' -e 's/__*/_/g') + echo "KB_CLEAN_ARTIFACT_NAME=$name" >> $GITHUB_ENV + - name: Archive firmware - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 continue-on-error: true with: - name: qmk_fingerpunch_${{ github.actor }} + name: qmk_fingerpunch_${{ env.KB_CLEAN_ARTIFACT_NAME }} path: | *.hex *.bin *.uf2 -