--- /dev/null
+build:
+ @./contrib/guix/guix-build
+
+codesign:
+ @./contrib/guix/guix-codesign
+
+attest:
+ @./contrib/guix/guix-attest
+
+verify:
+ @./contrib/guix/guix-attest
+
+clean:
+ @./contrib/guix/guix-clean
+
+DEFAULT_GOAL := default
+default: build
+
+.PHONY: default build attest verify clean
EOF
}
-if [ -z "$GUIX_SIGS_REPO" ] || [ -z "$SIGNER" ]; then
- cmd_usage
- exit 1
+if [ -z "${GUIX_SIGS_REPO}" ]; then
+ echo "[HINT] Fork and clone the feather-sigs repo, if you haven't already:"
+ echo "https://github.com/feather-wallet/feather-sigs"
+ echo ""
+
+ printf "Enter path to 'feather-sigs' repo: "
+ read -r repo
+
+ if [ ! -d "${repo}" ]; then
+ echo "ERR: directory does not exist"
+ exit 1
+ fi
+
+ export GUIX_SIGS_REPO="$repo"
+ wizard=1
+fi
+
+if [ -z "${SIGNER}" ]; then
+ printf "Enter your GitHub username: "
+ read -r signer
+
+ if [ -z "$signer" ]; then
+ echo "ERR: signer name can't be empty"
+ exit 1
+ fi
+
+ echo ""
+ echo "[HINT] To find your GPG fingerprint use:"
+ echo "gpg --list-secret-keys --keyid-format=long"
+ echo "It should look like: E87BD921CDD885C9D78A38C5E45B10DD027D2472"
+ echo ""
+
+ printf "Enter fingerprint of your GPG key: "
+ read -r fingerprint
+
+ export SIGNER="${fingerprint}=${signer}"
+ wizard=1
+fi
+
+if [ -n "$wizard" ]; then
+ echo ""
+ echo "Next time, invoke this command as:"
+ echo "env GUIX_SIGS_REPO=${GUIX_SIGS_REPO} SIGNER=${SIGNER} make attest"
+ echo ""
fi
################
}
if [ -z "$GUIX_SIGS_REPO" ]; then
- cmd_usage
- exit 1
+ echo "[HINT] Fork and clone the feather-sigs repo:"
+ echo "https://github.com/feather-wallet/feather-sigs"
+ echo ""
+
+ printf "Enter path to 'feather-sigs' repo: "
+ read -r GUIX_SIGS_REPO
+
+ if [ ! -d "${GUIX_SIGS_REPO}" ]; then
+ echo "Directory does not exist"
+ exit 1
+ fi
+
+ echo ""
+ echo "Next time, invoke this command as:"
+ echo "env GUIX_SIGS_REPO=${GUIX_SIGS_REPO} make codesign"
+ echo ""
fi
################
if ! git -C "$GUIX_SIGS_REPO" diff-index --quiet HEAD -- && [ -z "$FORCE_DIRTY_WORKTREE" ]; then
cat << EOF
-ERR: The DETACHED CODESIGNATURE git worktree is dirty, which may lead to broken builds.
+ERR: The FEATHER SIGS git worktree is dirty, which may lead to broken builds.
Aborting...
EOF
}
-if [ -z "$GUIX_SIGS_REPO" ]; then
- cmd_usage
- exit 1
+if [ -z "${GUIX_SIGS_REPO}" ]; then
+ printf "Enter path to 'feather-sigs' repo: "
+ read -r GUIX_SIGS_REPO
+
+ if [ ! -d "${GUIX_SIGS_REPO}" ]; then
+ echo "Directory does not exist"
+ exit 1
+ fi
+
+ echo ""
+ echo "Next time, invoke this command as:"
+ echo "env GUIX_SIGS_REPO=${GUIX_SIGS_REPO} make verify"
+ echo ""
fi
################