This commit is contained in:
曾志威
2026-09-25 10:38:16 +08:00
parent 8177efe388
commit 92ae03d08a
3 changed files with 20 additions and 16 deletions
+3 -14
View File
@@ -17,27 +17,20 @@ steps:
image: alpine:3.22
commands:
- apk add --no-cache git ca-certificates
- git --version
- |
set -eu
set +x
test -n "$${DRONE_GIT_HTTP_URL:-}" || { echo 'DRONE_GIT_HTTP_URL is required'; exit 1; }
test -n "$${DRONE_COMMIT_SHA:-}" || { echo 'DRONE_COMMIT_SHA is required'; exit 1; }
: "$${DRONE_GIT_HTTP_URL:?}" "$${DRONE_COMMIT_SHA:?}"
if test -n "$${DRONE_NETRC_MACHINE:-}"; then
(umask 077; printf 'machine %s\nlogin %s\npassword %s\n' "$DRONE_NETRC_MACHINE" "$DRONE_NETRC_USERNAME" "$DRONE_NETRC_PASSWORD" > "$HOME/.netrc")
fi
git clone --no-checkout -- "$DRONE_GIT_HTTP_URL" .
printf 'Repository object format: '
git rev-parse --show-object-format
if test -n "$${DRONE_COMMIT_REF:-}"; then
git fetch --no-tags origin "$DRONE_COMMIT_REF"
fi
if ! git cat-file -e "$DRONE_COMMIT_SHA^{commit}" 2>/dev/null; then
git fetch --no-tags origin "$DRONE_COMMIT_SHA"
fi
git cat-file -e "$DRONE_COMMIT_SHA^{commit}" 2>/dev/null || git fetch --no-tags origin "$DRONE_COMMIT_SHA"
git checkout --detach "$DRONE_COMMIT_SHA"
test "$(git rev-parse HEAD)" = "$DRONE_COMMIT_SHA" || { echo 'Checked out commit does not match this build'; exit 1; }
git log -1 --format='Checked out commit: %H'
- name: frontend-build
image: node:22.19.0-alpine
@@ -66,8 +59,4 @@ steps:
- node --test scripts/build-ci-release.test.mjs scripts/ci-release.test.mjs
- node scripts/verify-package.mjs bin/build-cache/ci-release/linux-amd64/serviceport
- node scripts/ci-release.mjs package
- |
case "$DRONE_BUILD_EVENT" in
push|tag) node scripts/ci-release.mjs upload ;;
*) echo 'IPFS upload skipped for this event; no download URLs were generated.' ;;
esac
- node scripts/ci-release.mjs upload