77 lines
2.5 KiB
YAML
77 lines
2.5 KiB
YAML
kind: pipeline
|
|
name: default
|
|
|
|
environment:
|
|
http_proxy: http://192.168.9.1:7893
|
|
https_proxy: http://192.168.9.1:7893
|
|
no_proxy: localhost,127.0.0.1,::1
|
|
HTTP_PROXY: http://192.168.9.1:7893
|
|
HTTPS_PROXY: http://192.168.9.1:7893
|
|
NO_PROXY: localhost,127.0.0.1,::1
|
|
|
|
clone:
|
|
disable: true
|
|
|
|
steps:
|
|
- name: clone
|
|
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; }
|
|
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 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
|
|
commands:
|
|
- npm --prefix web ci --no-audit --no-fund
|
|
- npm --prefix web run build
|
|
|
|
- name: build-binaries
|
|
image: golang:1.25.0-alpine
|
|
environment:
|
|
GOTOOLCHAIN: go1.25.0
|
|
CGO_ENABLED: "0"
|
|
commands:
|
|
- apk add --no-cache git
|
|
- sh scripts/build-ci-release.sh
|
|
|
|
- name: package
|
|
image: node:22.19.0-alpine
|
|
commands:
|
|
- apk add --no-cache libarchive-tools curl
|
|
- node --test scripts/ci-release.test.mjs
|
|
- node scripts/verify-package.mjs bin/build-cache/ci-release/linux-amd64/serviceport
|
|
- node scripts/ci-release.mjs package
|
|
|
|
- name: upload-ipfs
|
|
image: node:22.19.0-alpine
|
|
environment:
|
|
IPFS_API: https://ipfs.freeicu.top
|
|
IPFS_TOKEN: "674d69308edc52450a5fff0e64947703de3d47d723810b53833ec9d4e999f20e"
|
|
commands:
|
|
- apk add --no-cache curl
|
|
- node scripts/ci-release.mjs upload
|
|
when:
|
|
event:
|
|
- push
|
|
- tag
|