#!/usr/bin/env bash # What a release of LLeMbas IDE carries, written into dist/: # llembas-ide-.tar.gz ide/ (the installer, the configuration, the lock files) and # nvim/ (the LLeMbas plugin), with VERSION and LICENSE # install.sh the installer, for: curl -fsSL /install.sh | bash # SHA256SUMS of every release file in dist/ (the .vsix too, when it is there) # SHA256SUMS.sig with --sign : signed with ssh-keygen in the namespace # lembas-release, which install.sh checks once it is given the key # # scripts/package-ide.sh [--sign ] # # The archive is made from the files git tracks, in a fixed order with fixed times and owners, so # the same commit gives the same bytes. The version is the repository's VERSION file. set -euo pipefail cd "$(dirname "$0")/.." sign="" while [ $# -gt 0 ]; do case "$1" in --sign) sign="${2:?--sign needs a key file}" && shift ;; *) echo "package-ide: unknown option $1" >&2 && exit 2 ;; esac shift done version="$(tr -d '[:space:]' "dist/$name.tar.gz" cp ide/install.sh dist/install.sh ( cd dist files=("$name.tar.gz" install.sh) [ ! -f "llembas-$version.vsix" ] || files+=("llembas-$version.vsix") sha256sum "${files[@]}" >SHA256SUMS ) rm -f dist/SHA256SUMS.sig if [ -n "$sign" ]; then ssh-keygen -Y sign -q -f "$sign" -n lembas-release dist/SHA256SUMS fi echo "package-ide: dist/$name.tar.gz, dist/install.sh, dist/SHA256SUMS$([ -z "$sign" ] || echo ", dist/SHA256SUMS.sig")"