first commit

This commit is contained in:
암냥 2026-03-05 03:06:24 +09:00
commit 46aea254d0
No known key found for this signature in database
19 changed files with 569 additions and 0 deletions

47
sign-firefox.sh Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCE_DIR="$ROOT_DIR/dist/firefox"
SIGNED_DIR="$ROOT_DIR/dist/signed"
if [ -f "$ROOT_DIR/.env" ]; then
set -a
# shellcheck disable=SC1091
. "$ROOT_DIR/.env"
set +a
fi
if [ -z "${AMO_JWT_ISSUER:-}" ] || [ -z "${AMO_JWT_SECRET:-}" ]; then
echo "AMO_JWT_ISSUER / AMO_JWT_SECRET 값이 필요합니다."
echo "(.env 또는 환경변수에서 읽습니다)"
echo "예:"
echo " export AMO_JWT_ISSUER=\"<your-api-key>\""
echo " export AMO_JWT_SECRET=\"<your-api-secret>\""
exit 1
fi
"$ROOT_DIR/build-firefox.sh"
mkdir -p "$SIGNED_DIR"
if command -v web-ext >/dev/null 2>&1; then
web-ext sign \
--source-dir "$SOURCE_DIR" \
--artifacts-dir "$SIGNED_DIR" \
--api-key "$AMO_JWT_ISSUER" \
--api-secret "$AMO_JWT_SECRET" \
--channel unlisted
elif command -v npx >/dev/null 2>&1; then
npx --yes web-ext sign \
--source-dir "$SOURCE_DIR" \
--artifacts-dir "$SIGNED_DIR" \
--api-key "$AMO_JWT_ISSUER" \
--api-secret "$AMO_JWT_SECRET" \
--channel unlisted
else
echo "web-ext 또는 npx가 필요합니다."
echo "Nix 사용 시: nix develop -c ./sign-firefox.sh"
exit 1
fi
echo "Signed XPI generated under: $SIGNED_DIR"