Replace deprecated workflow set-output commands

This commit is contained in:
Manna Harbour 2022-10-21 20:44:24 +11:00
parent aa33c0c539
commit cfeadfaa6f
3 changed files with 18 additions and 18 deletions

View File

@ -92,7 +92,7 @@ jobs:
set-output() set-output()
{ {
json=`echo "$2" | jq -cnR 'inputs | split(",";"")'` json=`echo "$2" | jq -cnR 'inputs | split(",";"")'`
echo "::set-output name=$1::$json" echo "$1=$json" >> $GITHUB_OUTPUT
} }
set-output "board" "${{ github.event.inputs.board }}" set-output "board" "${{ github.event.inputs.board }}"
set-output "shield" "${{ github.event.inputs.shield }}" set-output "shield" "${{ github.event.inputs.shield }}"

View File

@ -62,7 +62,7 @@ jobs:
with: with:
path: 'miryoku_zmk' path: 'miryoku_zmk'
- name: main - name: main
id: variables id: main
run: | run: |
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && set -x test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && set -x
@ -77,12 +77,11 @@ jobs:
keyboard=${{ matrix.board }} keyboard=${{ matrix.board }}
shield="" shield=""
fi fi
echo "::set-output name=shield-arg::${SHIELD_ARG}" echo "shield_arg=${SHIELD_ARG}" >> $GITHUB_OUTPUT
keyboard_split="$keyboard" keyboard_split="$keyboard"
keyboard_base=`echo "$keyboard" | sed 's/_\(left\|right\)//'` keyboard_base=`echo "$keyboard" | sed 's/_\(left\|right\)//'`
configfile="${GITHUB_WORKSPACE}/miryoku_zmk/miryoku/custom_config.h" configfile="${GITHUB_WORKSPACE}/miryoku_zmk/miryoku/custom_config.h"
echo "::set-output name=configfile::$configfile"
tmpfile="$configfile.tmp" tmpfile="$configfile.tmp"
echo -n '#define ' > "$tmpfile" echo -n '#define ' > "$tmpfile"
@ -111,11 +110,11 @@ jobs:
esac esac
done done
artifacts_dir="${GITHUB_WORKSPACE}/artifacts" artifact_dir="${GITHUB_WORKSPACE}/artifacts"
echo "::set-output name=artifact-dir::$artifacts_dir" echo "artifact_dir=$artifact_dir" >> $GITHUB_OUTPUT
mkdir "$artifacts_dir" mkdir "$artifact_dir"
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "$configfile" "$artifacts_dir" test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "$configfile" "$artifact_dir"
if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ]
then then
@ -123,7 +122,7 @@ jobs:
echo "${{ matrix.kconfig }}" >> "$kconfig_file" echo "${{ matrix.kconfig }}" >> "$kconfig_file"
artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | head -c "$hash_length"` 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" "$artifact_dir"
. "${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/zmk" . "${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/zmk"
@ -141,7 +140,7 @@ jobs:
outboard_file="${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/outboards/$outboard" outboard_file="${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/outboards/$outboard"
if [ -f "$outboard_file" ] if [ -f "$outboard_file" ]
then then
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "$outboard_file" "$artifacts_dir" test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "$outboard_file" "$artifact_dir"
. "$outboard_file" . "$outboard_file"
outboard_dir="${GITHUB_WORKSPACE}/outboards/$outboard" outboard_dir="${GITHUB_WORKSPACE}/outboards/$outboard"
if [ -n "$outboard_repository" -a -n "$outboard_ref" ] if [ -n "$outboard_repository" -a -n "$outboard_ref" ]
@ -175,8 +174,9 @@ jobs:
fi fi
artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` artifact_build_name=`echo $artifact_build_name | tr ' ' '-'`
echo "::set-output name=artifact-build-name::$artifact_build_name" echo "artifact_build_name=$artifact_build_name" >> $GITHUB_OUTPUT
echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` artifact_generic_name=`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'`
echo "artifact_generic_name=$artifact_generic_name" >> $GITHUB_OUTPUT
user=`echo "$zmk" | cut -f 1 -d '/'` user=`echo "$zmk" | cut -f 1 -d '/'`
repo=`echo "$zmk" | cut -f 2 -d '/'` repo=`echo "$zmk" | cut -f 2 -d '/'`
@ -238,7 +238,7 @@ jobs:
EX_DATAERR='65' EX_DATAERR='65'
cd "${GITHUB_WORKSPACE}/zmk/app" cd "${GITHUB_WORKSPACE}/zmk/app"
{ {
west $west_debug build -b ${{ matrix.board }} $west_build_debug -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/miryoku_zmk/config" || west $west_debug build -b ${{ matrix.board }} $west_build_debug -- ${{ steps.main.outputs.shield_arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/miryoku_zmk/config" ||
echo "$build_failed_message $?." ; echo "$build_failed_message $?." ;
} 2>&1 | tee "$log" } 2>&1 | tee "$log"
if grep -q 'Invalid BOARD; see above.' "$log" if grep -q 'Invalid BOARD; see above.' "$log"
@ -273,15 +273,15 @@ jobs:
file="${GITHUB_WORKSPACE}/zmk/app/build/zephyr/zmk.$extension" file="${GITHUB_WORKSPACE}/zmk/app/build/zephyr/zmk.$extension"
if [ -f "$file" ] if [ -f "$file" ]
then then
cp "$file" "${{ steps.variables.outputs.artifact-dir }}/${{ steps.variables.outputs.artifact-build-name }}.$extension" cp "$file" "${{ steps.main.outputs.artifact_dir }}/${{ steps.main.outputs.artifact_build_name }}.$extension"
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' || break test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' || break
fi fi
done done
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "${GITHUB_WORKSPACE}/zmk/app/build/zephyr/.config" "${{ steps.variables.outputs.artifact-dir }}" test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "${GITHUB_WORKSPACE}/zmk/app/build/zephyr/.config" "${{ steps.main.outputs.artifact_dir }}"
echo "::endgroup::" echo "::endgroup::"
- name: upload - name: upload
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ steps.variables.outputs.artifact-generic-name }} name: ${{ steps.main.outputs.artifact_generic_name }}
path: ${{ steps.variables.outputs.artifact-dir }} path: ${{ steps.main.outputs.artifact_dir }}

View File

@ -65,7 +65,7 @@ jobs:
set-output() set-output()
{ {
json=`echo "$2" | jq -cnR 'inputs | split(",";"")'` json=`echo "$2" | jq -cnR 'inputs | split(",";"")'`
echo "::set-output name=$1::$json" echo "$1=$json" >> $GITHUB_OUTPUT
} }
set-output "board" "${{ github.event.inputs.board }}" set-output "board" "${{ github.event.inputs.board }}"
set-output "shield" "${{ github.event.inputs.shield }}" set-output "shield" "${{ github.event.inputs.shield }}"