1
0
Fork 0
mirror of https://git.madhouse-project.org/actions/nix.git synced 2025-05-09 21:59:53 +02:00

build: Allow setting the out link

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2023-09-25 10:04:42 +02:00
parent 3cac748ae0
commit 795ee85b9a
3 changed files with 8 additions and 2 deletions

View file

@ -14,6 +14,10 @@ inputs:
description: "Enable showing the full build logs"
default: false
required: false
out-link:
description: "Use this prefix for the symlinks to the build results"
default: "result"
required: true
outputs:
output-path:
description: "The resulting output paths"
@ -28,3 +32,4 @@ runs:
INPUT_FLAKE: ${{ inputs.flake }}
INPUT_PACKAGE: ${{ inputs.package }}
INPUT_LOGS: ${{ inputs.logs }}
INPUT_OUT_LINK: ${{ inputs.out-link }}

View file

@ -8,5 +8,5 @@ case "${INPUT_LOGS}" in
;;
esac
nix build ${LOGS} "${INPUT_FLAKE}#${INPUT_PACKAGE}"
echo "output-path=$(readlink result)" >>"${GITHUB_OUTPUT}"
nix build ${LOGS} --out-link "${INPUT_OUT_LINK}" "${INPUT_FLAKE}#${INPUT_PACKAGE}"
echo "output-path=$(readlink "${INPUT_OUT_LINK}")" >>"${GITHUB_OUTPUT}"