internal/rosa/hakurei: isolate hakurei helper
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m37s
Test / Hakurei (push) Successful in 3m47s
Test / ShareFS (push) Successful in 3m55s
Test / Hpkg (push) Successful in 4m26s
Test / Sandbox (race detector) (push) Successful in 4m58s
Test / Hakurei (race detector) (push) Successful in 5m52s
Test / Flake checks (push) Successful in 1m52s
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m37s
Test / Hakurei (push) Successful in 3m47s
Test / ShareFS (push) Successful in 3m55s
Test / Hpkg (push) Successful in 4m26s
Test / Sandbox (race detector) (push) Successful in 4m58s
Test / Hakurei (race detector) (push) Successful in 5m52s
Test / Flake checks (push) Successful in 1m52s
For creating the dist tarball, which runs in the same environment. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"hakurei.app/internal/pkg"
|
||||
)
|
||||
|
||||
func (t Toolchain) newHakurei() pkg.Artifact {
|
||||
func (t Toolchain) newHakurei(script string) pkg.Artifact {
|
||||
const (
|
||||
version = "0.3.4"
|
||||
checksum = "wVwSLo75a2OnH5tgxNWXR_YhiOJUFnYM_9-sJtxAEOKhcPE0BJafs6PU8o5JzyCT"
|
||||
@@ -39,27 +39,9 @@ echo
|
||||
|
||||
chmod -R +w /usr/src/hakurei
|
||||
cd /usr/src/hakurei
|
||||
mkdir -p /work/system/{bin,libexec/hakurei}
|
||||
|
||||
echo '# Building hakurei.'
|
||||
go generate -v ./...
|
||||
go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
|
||||
-buildid=
|
||||
-extldflags=-static
|
||||
-X hakurei.app/internal/info.buildVersion='v`+version+`'
|
||||
-X hakurei.app/internal/info.hakureiPath=/system/bin/hakurei
|
||||
-X hakurei.app/internal/info.hsuPath=/system/bin/hsu
|
||||
-X main.hakureiPath=/system/bin/hakurei" ./...
|
||||
echo
|
||||
|
||||
echo '# Testing hakurei.'
|
||||
go test -ldflags='-buildid= -extldflags=-static' ./...
|
||||
echo
|
||||
|
||||
mv \
|
||||
/work/system/libexec/hakurei/{hakurei,hpkg} \
|
||||
/work/system/bin
|
||||
`, pkg.Path(AbsUsrSrc.Append("hakurei"), true, pkg.NewHTTPGetTar(
|
||||
HAKUREI_VERSION='v`+version+`'
|
||||
`+script, pkg.Path(AbsUsrSrc.Append("hakurei"), true, pkg.NewHTTPGetTar(
|
||||
nil, "https://git.gensokyo.uk/security/hakurei/archive/"+
|
||||
"v"+version+".tar.gz",
|
||||
mustDecode(checksum),
|
||||
@@ -81,4 +63,29 @@ func main() {
|
||||
`),
|
||||
)))
|
||||
}
|
||||
func init() { artifactsF[Hakurei] = Toolchain.newHakurei }
|
||||
func init() {
|
||||
artifactsF[Hakurei] = func(t Toolchain) pkg.Artifact {
|
||||
return t.newHakurei(`
|
||||
mkdir -p /work/system/{bin,libexec/hakurei}
|
||||
|
||||
echo '# Building hakurei.'
|
||||
go generate -v ./...
|
||||
go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
|
||||
-buildid=
|
||||
-extldflags=-static
|
||||
-X hakurei.app/internal/info.buildVersion="$HAKUREI_VERSION"
|
||||
-X hakurei.app/internal/info.hakureiPath=/system/bin/hakurei
|
||||
-X hakurei.app/internal/info.hsuPath=/system/bin/hsu
|
||||
-X main.hakureiPath=/system/bin/hakurei" ./...
|
||||
echo
|
||||
|
||||
echo '# Testing hakurei.'
|
||||
go test -ldflags='-buildid= -extldflags=-static' ./...
|
||||
echo
|
||||
|
||||
mv \
|
||||
/work/system/libexec/hakurei/{hakurei,sharefs} \
|
||||
/work/system/bin
|
||||
`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user