Reduce firmware artifact filename length

- Uploading artifacts fails if the filename is too long
- 240 characters is too long
- Reduce md5sum hashes from 32 to 16 characters
This commit is contained in:
Manna Harbour 2022-06-20 17:29:11 +10:00
parent 09abdd2c45
commit aa6bb9f674

View File

@ -91,11 +91,12 @@ jobs:
mv "$tmpfile" "$configfile" mv "$tmpfile" "$configfile"
artifact_build_name="miryoku_zmk $shield ${{ matrix.board }}" artifact_build_name="miryoku_zmk $shield ${{ matrix.board }}"
hash_length=16
if [ -n "${{ matrix.custom_config }}" -a "${{ matrix.custom_config }}" != 'default' ] if [ -n "${{ matrix.custom_config }}" -a "${{ matrix.custom_config }}" != 'default' ]
then then
echo "${{ matrix.custom_config }}" >> "$configfile" echo "${{ matrix.custom_config }}" >> "$configfile"
artifact_build_name="$artifact_build_name config_"`echo "${{ matrix.custom_config }}" | md5sum | cut -d ' ' -f 1` artifact_build_name="$artifact_build_name config_"`echo "${{ matrix.custom_config }}" | md5sum | head -c "$hash_length"`
fi fi
for option in "alphas_${{ matrix.alphas }}" "nav_${{ matrix.nav }}" "clipboard_${{ matrix.clipboard }}" "layers_${{ matrix.layers }}" "mapping_${{ matrix.mapping }}" for option in "alphas_${{ matrix.alphas }}" "nav_${{ matrix.nav }}" "clipboard_${{ matrix.clipboard }}" "layers_${{ matrix.layers }}" "mapping_${{ matrix.mapping }}"
@ -120,7 +121,7 @@ jobs:
then then
kconfig_file="${GITHUB_WORKSPACE}/miryoku_zmk/config/$keyboard_split.conf" kconfig_file="${GITHUB_WORKSPACE}/miryoku_zmk/config/$keyboard_split.conf"
echo "${{ matrix.kconfig }}" >> "$kconfig_file" echo "${{ matrix.kconfig }}" >> "$kconfig_file"
artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | head -c "$hash_length"`
fi fi
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && test -f "$kconfig_file" && cp "$kconfig_file" "$artifacts_dir" test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && test -f "$kconfig_file" && cp "$kconfig_file" "$artifacts_dir"
@ -168,7 +169,7 @@ jobs:
echo "::group::zmk" echo "::group::zmk"
if [ -n "${{ matrix.branches }}" -a "${{ matrix.branches }}" != 'default' ] if [ -n "${{ matrix.branches }}" -a "${{ matrix.branches }}" != 'default' ]
then then
artifact_build_name="$artifact_build_name branches_"`echo "${{ matrix.branches }}" | md5sum | cut -d ' ' -f 1` artifact_build_name="$artifact_build_name branches_"`echo "${{ matrix.branches }}" | md5sum | head -c "$hash_length"`
zmk=`echo "${{ matrix.branches }}" | cut -d ' ' -f 1` zmk=`echo "${{ matrix.branches }}" | cut -d ' ' -f 1`
merges=`echo "${{ matrix.branches }}" | cut -d ' ' -f 2- -s` merges=`echo "${{ matrix.branches }}" | cut -d ' ' -f 2- -s`
fi fi