refactor CI and Makefile for Nushell installation
the idea is to make the installation of Nushell easier to maintain, especially regarding versions, currently pinned to 0.95.0
successful run on GitHub: 13032726635
this is also to allow easier testing locally with the same Nushell version as in the CI, e.g.
# install in `~/.local/bin/` and have multiple versions
make install-nu
hash=$(/tmp/nu --no-config-file --commands 'version | get commit_hash')
nu_bin=$"$HOME/.local/bin/nu-$hash"
cp /tmp/nu $nu_bin
make NU=$nu_bin show test
or
# install in the repo and overwrite each time
make NU_DEST=. install-nu
make NU=./nu show test
changelog
- Makefile
- split the global
.PHONYrule into atomic rules next to each phony rule - define
NUandNU_FLAGSto allow changing which and how Nushell runs - define
NU_ARCH,NU_VERSION,NU_BUILDandNU_DESTfor Nushell installation - tweak the output of
make showa bit - add
print-%rules to printMakefilevariables, e.g.make print-NU_FLAGSwould print--no-config-file - add
make install-nuto replace the ones from the CIs
- split the global
- GitLab CI
- use
make install-nu - export
PATHwithmake print-NU_DEST
- use
- GitHub CI
- use
make install-nuinstead of github.com:hustcer/setup-nu - export
PATHwithmake print-NU_DESTandGITHUB_ENV
- use
Edited by STEVAN Antoine