diff --git a/documentation/installation.rst b/documentation/installation.rst index ba7531e..b7f63fc 100644 --- a/documentation/installation.rst +++ b/documentation/installation.rst @@ -31,12 +31,13 @@ See the `releases page on GitHub As a shortcut, the following are the self-contained and statically linked all-in-one server and archiver executables -(for x86_64 / amd64 processors): +(for x86_64 / amd64 and aarch64 / arm64 processors): - * ``__ - * ``__ - * ``__ - * ``__ + * ``__ + * ``__ + * ``__ + * ``__ + * ``__ For example, assuming one wants the ``preview`` version, @@ -45,19 +46,19 @@ one can run the following commands: :: curl \ -s -S -f -L \ -o /tmp/kawipiko-server \ - https://github.com/volution/kawipiko/releases/download/preview/kawipiko-server--linux--v0.1.0--preview \ + https://github.com/volution/kawipiko/releases/download/preview/kawipiko-server--linux--x86_64--v0.1.0--preview \ # curl \ -s -S -f -L \ -o /tmp/kawipiko-archiver \ - https://github.com/volution/kawipiko/releases/download/preview/kawipiko-archiver--linux--v0.1.0--preview \ + https://github.com/volution/kawipiko/releases/download/preview/kawipiko-archiver--linux--x86_64--v0.1.0--preview \ # curl \ -s -S -f -L \ -o /tmp/kawipiko \ - https://github.com/volution/kawipiko/releases/download/preview/kawipiko-wrapper--linux--v0.1.0--preview \ + https://github.com/volution/kawipiko/releases/download/preview/kawipiko-wrapper--linux--x86_64--v0.1.0--preview \ # chmod a=rx /tmp/kawipiko-server diff --git a/scripts/deploy.z-run b/scripts/deploy.z-run index df9a055..7f2996f 100644 --- a/scripts/deploy.z-run +++ b/scripts/deploy.z-run @@ -8,10 +8,12 @@ ---:: deploy / rsync / * / linux :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' linux "${@}" ---:: deploy / rsync / * / darwin :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' darwin "${@}" ---:: deploy / rsync / * / freebsd :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' freebsd "${@}" ---:: deploy / rsync / * / openbsd :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' openbsd "${@}" +--:: deploy / rsync / * / linux / x86_64 :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' linux--x86_64 "${@}" +--:: deploy / rsync / * / darwin / x86_64 :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' darwin--x86_64 "${@}" +--:: deploy / rsync / * / darwin / aarch64 :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' darwin--aarch64 "${@}" +--:: deploy / rsync / * / freebsd / x86_64 :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' freebsd--x86_64 "${@}" +--:: deploy / rsync / * / openbsd / x86_64 :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' openbsd--x86_64 "${@}" +--:: deploy / rsync / * / android / aarch64 :: exec -- "${ZRUN[@]}" ':: deploy / rsync / *' android--aarch64 "${@}" @@ -19,7 +21,7 @@ --<< deploy / rsync / * test "${#}" -eq 3 ; _os="${1}" ; _main="${2}" ; _target="${3}" ; shift -- 3 "${ZRUN[@]}" ':: deploy / release' "${_os}" "${_main}" - _source="./.outputs/binaries/release/${_main}--${_os}" + _source="./.outputs/binaries/publish/${_main}--${_os}" printf -- '[ii] deploying `%s` for `%s` to `%s`...\n' "${_main}" "${_os}" "${_target}" >&2 exec -- rsync -i -t -p --chmod=0555 -- "${_source}" "${_target}" !! @@ -27,6 +29,12 @@ +<< deploy / publish / no-github + export -- __DEPLOY_NOGITHUB=true + exec -- "${ZRUN[@]}" ':: deploy / publish' "${@}" +!! + + << deploy / publish if test "${#}" -eq 0 ; then @@ -41,6 +49,13 @@ test -d ./.publish/ + if test "${__DEPLOY_NOGITHUB:-}" == true ; then + _github_publish=false + else + _github_publish=true + fi + + _build_version="${__BUILD_VERSION}" case "${_build_version}" in ( 0.0.0 | *.0 ) @@ -59,7 +74,7 @@ if test "${_main_0}" != all -a "${_main_0}" != "${_main}" ; then continue fi - for _os in linux darwin freebsd openbsd ; do + for _os in linux--x86_64 darwin--x86_64 darwin--aarch64 freebsd--x86_64 openbsd--x86_64 android--aarch64 ; do if test -e "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}" ; then printf -- '[ee] release already exists for `%s` for `%s`!\n' "${_main}" "${_os}" >&2 exit -- 1 @@ -69,13 +84,15 @@ fi - if ! git diff --quiet ; then - printf -- '[ee] dirty repository (before build); aborting!\n' >&2 - exit -- 1 - fi - if ! git diff --cached --quiet ; then - printf -- '[ee] dirty repository (before build); aborting!\n' >&2 - exit -- 1 + if test "${_github_publish}" == true ; then + if ! git diff --quiet ; then + printf -- '[ee] dirty repository (before build); aborting!\n' >&2 + exit -- 1 + fi + if ! git diff --cached --quiet ; then + printf -- '[ee] dirty repository (before build); aborting!\n' >&2 + exit -- 1 + fi fi @@ -84,33 +101,35 @@ "${ZRUN[@]}" ':: deploy / release' all "${_main_0}" - if ! git diff --quiet ; then - printf -- '[ee] dirty repository (after build); aborting!\n' >&2 - exit -- 1 + if test "${_github_publish}" == true ; then + + if ! git diff --quiet ; then + printf -- '[ee] dirty repository (after build); aborting!\n' >&2 + exit -- 1 + fi + if ! git diff --cached --quiet ; then + printf -- '[ee] dirty repository (after build); aborting!\n' >&2 + exit -- 1 + fi + + printf -- '[ii] tagging and pushing for `%s`...\n' "${_build_version}${_build_suffix}" >&2 + printf -- '[--]\n' >&2 + + if test "${_build_release}" == true ; then + git tag --sign -m "[release] Release \`v${_build_version}\`." -- "v${_build_version}" HEAD + else + git tag --sign -m "[preview] Preview \`v${_build_version}\`." --force -- preview HEAD + fi + + "${ZRUN[@]}" ':: github / push' + + printf -- '[--]\n' >&2 fi - if ! git diff --cached --quiet ; then - printf -- '[ee] dirty repository (after build); aborting!\n' >&2 - exit -- 1 - fi - - - printf -- '[ii] tagging and pushing for `%s`...\n' "${_build_version}${_build_suffix}" >&2 - printf -- '[--]\n' >&2 - - if test "${_build_release}" == true ; then - git tag --sign -m "[release] Release \`v${_build_version}\`." -- "v${_build_version}" HEAD - else - git tag --sign -m "[preview] Preview \`v${_build_version}\`." --force -- preview HEAD - fi - - "${ZRUN[@]}" ':: github / push' - - printf -- '[--]\n' >&2 printf -- '[ii] publishing all for `%s`...\n' "${_build_version}${_build_suffix}" >&2 - for _os in linux darwin freebsd openbsd ; do + for _os in linux--x86_64 darwin--x86_64 darwin--aarch64 freebsd--x86_64 openbsd--x86_64 android--aarch64 ; do for _main in kawipiko-wrapper kawipiko-archiver kawipiko-server kawipiko-server-dummy ; do if test "${_main_0}" != all -a "${_main_0}" != "${_main}" ; then @@ -121,7 +140,7 @@ printf -- '[--]\n' >&2 rsync -i -t -p --chmod=0555 -- \ - "./.outputs/binaries/release/${_main}--${_os}" \ + "./.outputs/binaries/publish/${_main}--${_os}" \ "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}" \ # @@ -158,31 +177,34 @@ done - printf -- '[ii] publishing all for `%s` (on GitHub)...\n' "${_build_version}${_build_suffix}" >&2 - - for _os in linux darwin freebsd openbsd ; do - for _main in kawipiko-wrapper kawipiko-archiver kawipiko-server kawipiko-server-dummy ; do - - if test "${_main_0}" != all -a "${_main_0}" != "${_main}" ; then - continue - fi - - printf -- '[ii] publishing `%s` for `%s` for `%s` (on GitHub)...\n' "${_main}" "${_os}" "${_build_version}${_build_suffix}" >&2 - - if test "${_build_release}" == true ; then - gh release upload --clobber -- "v${_build_version}" \ - "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}" \ - "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}.asc" \ - # - else - gh release upload --clobber -- preview \ - "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}" \ - "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}.asc" \ - # - fi - + if test "${_github_publish}" == true ; then + + printf -- '[ii] publishing all for `%s` (on GitHub)...\n' "${_build_version}${_build_suffix}" >&2 + + for _os in linux--x86_64 darwin--x86_64 darwin--aarch64 freebsd--x86_64 openbsd--x86_64 android--aarch64 ; do + for _main in kawipiko-wrapper kawipiko-archiver kawipiko-server kawipiko-server-dummy ; do + + if test "${_main_0}" != all -a "${_main_0}" != "${_main}" ; then + continue + fi + + printf -- '[ii] publishing `%s` for `%s` for `%s` (on GitHub)...\n' "${_main}" "${_os}" "${_build_version}${_build_suffix}" >&2 + + if test "${_build_release}" == true ; then + gh release upload --clobber -- "v${_build_version}" \ + "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}" \ + "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}.asc" \ + # + else + gh release upload --clobber -- preview \ + "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}" \ + "./.publish/${_os}/${_main}--${_os}--v${_build_version}${_build_suffix}.asc" \ + # + fi + + done done - done + fi !! @@ -209,11 +231,11 @@ if test "${_main_0}" != all -a "${_main_0}" != "${_main}" ; then continue fi - for _os in linux darwin freebsd openbsd ; do + for _os in linux--x86_64 darwin--x86_64 darwin--aarch64 freebsd--x86_64 openbsd--x86_64 android--aarch64 ; do if test "${_os_0}" != all -a "${_os_0}" != "${_os}" ; then continue fi - "${ZRUN[@]}" ':: go / build / all / release' "${_os}" "${_main#kawipiko-}" + "${ZRUN[@]}" ':: go / build / all / publish' "${_os}" "${_main#kawipiko-}" done done !! diff --git a/scripts/go.z-run b/scripts/go.z-run index b4ac29a..0fa0e5c 100644 --- a/scripts/go.z-run +++ b/scripts/go.z-run @@ -15,15 +15,27 @@ !! -++<< go / build / all / release / quick +++<< go / build / all / release printf -- '[ii] building archiver...\n' >&2 - "${ZRUN[@]}" ':: go / build / archiver / release / quick' "${@}" + "${ZRUN[@]}" ':: go / build / archiver / release' "${@}" printf -- '[ii] building server...\n' >&2 - "${ZRUN[@]}" ':: go / build / server / release / quick' "${@}" + "${ZRUN[@]}" ':: go / build / server / release' "${@}" printf -- '[ii] building server-dummy...\n' >&2 - "${ZRUN[@]}" ':: go / build / server-dummy / release / quick' "${@}" + "${ZRUN[@]}" ':: go / build / server-dummy / release' "${@}" printf -- '[ii] building wrapper...\n' >&2 - "${ZRUN[@]}" ':: go / build / wrapper / release / quick' "${@}" + "${ZRUN[@]}" ':: go / build / wrapper / release' "${@}" +!! + + +++<< go / build / all / release / quick + export -- __BUILD_QUICK=true + exec -- "${ZRUN[@]}" ':: go / build / all / release' +!! + + +++<< go / build / all / publish / quick + export -- __BUILD_QUICK=true + exec -- "${ZRUN[@]}" ':: go / build / all / publish' !! @@ -249,7 +261,7 @@ -++<< go / build / all / release +++<< go / build / all / publish if test "${#}" -ge 1 ; then _platform_0="${1}" shift -- 1 @@ -264,7 +276,7 @@ fi test "${#}" -eq 0 _outputs="$( exec -- readlink -e -- ./.outputs )" - for _platform in linux darwin openbsd freebsd ; do + for _platform in linux--x86_64 darwin--x86_64 darwin--aarch64 openbsd--x86_64 freebsd--x86_64 android--aarch64 ; do if test "${_platform_0}" != all -a "${_platform_0}" != "${_platform}" ; then continue fi @@ -272,12 +284,12 @@ if test "${_component_0}" != all -a "${_component_0}" != "${_component}" ; then continue fi - if test -e "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}" ; then - rm -f -- "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}" + if test -e "${_outputs}/binaries/publish/kawipiko-${_component}--${_platform}" ; then + rm -f -- "${_outputs}/binaries/publish/kawipiko-${_component}--${_platform}" fi done done - for _platform in linux darwin openbsd freebsd ; do + for _platform in linux--x86_64 darwin--x86_64 darwin--aarch64 openbsd--x86_64 freebsd--x86_64 android--aarch64 ; do if test "${_platform_0}" != all -a "${_platform_0}" != "${_platform}" ; then continue fi @@ -285,25 +297,55 @@ if test "${_component_0}" != all -a "${_component_0}" != "${_component}" ; then continue fi - test ! -e "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}" + test ! -e "${_outputs}/binaries/publish/kawipiko-${_component}--${_platform}" printf -- '[ii] building `%s` for `%s`...\n' "${_component}" "${_platform}" >&2 _flags=( #? -buildmode exe -tags netgo ) - _flags+=( - -gcflags 'all=-l=4' - -ldflags 'all=-s' - -trimpath - -a - ) - env GOOS="${_platform}" \ - nodaemon \ + if test "${__BUILD_QUICK:-false}" != true ; then + _flags+=( + -gcflags 'all=-l=4' + -ldflags 'all=-s' + -trimpath + -a + ) + fi + case "${_platform}" in + ( linux--x86_64 ) + export -- GOOS=linux + export -- GOARCH=amd64 + ;; + ( darwin--x86_64 ) + export -- GOOS=darwin + export -- GOARCH=amd64 + ;; + ( darwin--aarch64 ) + export -- GOOS=darwin + export -- GOARCH=arm64 + ;; + ( freebsd--x86_64 ) + export -- GOOS=freebsd + export -- GOARCH=amd64 + ;; + ( openbsd--x86_64 ) + export -- GOOS=openbsd + export -- GOARCH=amd64 + ;; + ( android--aarch64 ) + export -- GOOS=android + export -- GOARCH=arm64 + ;; + ( * ) + exit -- 1 + ;; + esac + nodaemon \ nice -n 19 -- \ "${ZRUN[@]}" ':: go / tool' \ build \ "${_flags[@]}" \ - -o "${_outputs}/binaries/release/kawipiko-${_component}--${_platform}" \ + -o "${_outputs}/binaries/publish/kawipiko-${_component}--${_platform}" \ -- "./cmd/${_component}.go" \ # done @@ -313,21 +355,6 @@ -<< go / build / all / publish - test "${#}" -eq 0 - for _platform in linux darwin openbsd freebsd ; do - for _component in archiver server server-dummy wrapper ; do - cp -T -- \ - "./.outputs/binaries/release/kawipiko-${_component}--${_platform}" \ - "./.outputs/publish/binaries/kawipiko-${_component}--${_platform}" \ - # - done - done -!! - - - - << go / build / server / analyze test "${#}" -eq 0 _outputs="$( exec -- readlink -e -- ./.outputs )" diff --git a/scripts/workspace.z-run b/scripts/workspace.z-run index 96adff9..511c86d 100644 --- a/scripts/workspace.z-run +++ b/scripts/workspace.z-run @@ -34,6 +34,7 @@ binaries binaries/debug binaries/release + binaries/publish binaries/analyze examples )