mirror of
https://git.madhouse-project.org/actions/nix.git
synced 2024-11-23 20:19:16 +01:00
build: Allow setting the out link
Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
parent
3cac748ae0
commit
795ee85b9a
3 changed files with 8 additions and 2 deletions
|
@ -44,6 +44,7 @@ A thin wrapper around `nix build`, to make it slightly easier to build flakes. W
|
||||||
flake: .
|
flake: .
|
||||||
package: # there's no default, Nix itself will fall back to "default"
|
package: # there's no default, Nix itself will fall back to "default"
|
||||||
logs: false
|
logs: false
|
||||||
|
out-link: "result"
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, it builds the default package in the flake at the root of the repository the action is used for, thus, if all you want to do is build the default package, and don't care about seeing full logs, you do not need to specify any parameters, the action will do the right thing out of the box.
|
By default, it builds the default package in the flake at the root of the repository the action is used for, thus, if all you want to do is build the default package, and don't care about seeing full logs, you do not need to specify any parameters, the action will do the right thing out of the box.
|
||||||
|
|
|
@ -14,6 +14,10 @@ inputs:
|
||||||
description: "Enable showing the full build logs"
|
description: "Enable showing the full build logs"
|
||||||
default: false
|
default: false
|
||||||
required: false
|
required: false
|
||||||
|
out-link:
|
||||||
|
description: "Use this prefix for the symlinks to the build results"
|
||||||
|
default: "result"
|
||||||
|
required: true
|
||||||
outputs:
|
outputs:
|
||||||
output-path:
|
output-path:
|
||||||
description: "The resulting output paths"
|
description: "The resulting output paths"
|
||||||
|
@ -28,3 +32,4 @@ runs:
|
||||||
INPUT_FLAKE: ${{ inputs.flake }}
|
INPUT_FLAKE: ${{ inputs.flake }}
|
||||||
INPUT_PACKAGE: ${{ inputs.package }}
|
INPUT_PACKAGE: ${{ inputs.package }}
|
||||||
INPUT_LOGS: ${{ inputs.logs }}
|
INPUT_LOGS: ${{ inputs.logs }}
|
||||||
|
INPUT_OUT_LINK: ${{ inputs.out-link }}
|
||||||
|
|
|
@ -8,5 +8,5 @@ case "${INPUT_LOGS}" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
nix build ${LOGS} "${INPUT_FLAKE}#${INPUT_PACKAGE}"
|
nix build ${LOGS} --out-link "${INPUT_OUT_LINK}" "${INPUT_FLAKE}#${INPUT_PACKAGE}"
|
||||||
echo "output-path=$(readlink result)" >>"${GITHUB_OUTPUT}"
|
echo "output-path=$(readlink "${INPUT_OUT_LINK}")" >>"${GITHUB_OUTPUT}"
|
||||||
|
|
Loading…
Reference in a new issue