3 Commits
Author SHA1 Message Date
Qiufeng e295ad8b96 ci: provision Java for signed releases
Signed Release / release (push) Successful in 17m17s
2026-08-04 17:18:25 +08:00
Qiufeng 99b8126b59 test: isolate release checks across platforms
Signed Release / release (push) Failing after 35s
2026-08-04 17:11:45 +08:00
Qiufeng b472581622 fix: pull runner from Gitea registry 2026-08-04 16:14:59 +08:00
3 changed files with 40 additions and 5 deletions
+7
View File
@@ -25,6 +25,13 @@ jobs:
with:
fetch-depth: 0
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: gradle
- name: Build, sign, and publish release
shell: bash
run: |
+28 -3
View File
@@ -4,7 +4,7 @@ set -Eeuo pipefail
GITEA_URL="${GITEA_URL:-http://38.76.196.225:10099/}"
GITEA_REPOSITORY="${GITEA_REPOSITORY:-awaioi/ERP}"
RUNNER_IMAGE="${RUNNER_IMAGE:-gitea/runner:3.0.2}"
RUNNER_IMAGE="${RUNNER_IMAGE:-}"
RUNNER_CONTAINER="${RUNNER_CONTAINER:-gitea-runner}"
RUNNER_VOLUME="${RUNNER_VOLUME:-gitea-runner-data}"
RUNNER_LABELS="${RUNNER_LABELS:-ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest}"
@@ -46,6 +46,32 @@ find_gitea_container() {
return 1
}
pull_runner_image() {
local candidate
local -a candidates
if [[ -n "$RUNNER_IMAGE" ]]; then
candidates=("$RUNNER_IMAGE")
else
candidates=(
"docker.gitea.com/runner:3.0.2"
"docker.gitea.com/act_runner:3.0.2"
"gitea/runner:3.0.2"
)
fi
for candidate in "${candidates[@]}"; do
log "Pulling $candidate"
if docker pull "$candidate"; then
RUNNER_IMAGE="$candidate"
return 0
fi
log "Image source failed; trying the next source"
done
fail "all official Gitea Runner image sources failed"
}
GITEA_CONTAINER="$(find_gitea_container || true)"
[[ -n "$GITEA_CONTAINER" ]] || fail "no running Gitea container was found"
@@ -72,8 +98,7 @@ fi
[[ -s "$TOKEN_FILE" ]] || fail "Gitea returned an empty runner token"
chmod 600 "$TOKEN_FILE"
log "Pulling $RUNNER_IMAGE"
docker pull "$RUNNER_IMAGE"
pull_runner_image
docker rm -f "$RUNNER_CONTAINER" >/dev/null 2>&1 || true
docker volume create "$RUNNER_VOLUME" >/dev/null
docker run --rm --entrypoint /bin/rm \
+5 -2
View File
@@ -312,7 +312,7 @@ PY
NO_SERVICE=0
PUBLIC_KEY="$(<"$tmp/public.pem")"
detect_platform() { PLATFORM=darwin; }
detect_platform() { PLATFORM=darwin; ARCH=amd64; }
check_and_install_dependencies() { JAVA_BIN="$(command -v java)"; return 0; }
start_service() { return 0; }
wait_for_installer() { return 0; }
@@ -323,7 +323,7 @@ PY
[[ -r "$INSTALL_ROOT/current/app/kaidi-erp.jar" ]] || return 1
(
source "$ERP_CONFIG_ROOT/erp.env"
[[ "$SPRING_PROFILES_ACTIVE" == "postgres" ]]
[[ -z "${SPRING_PROFILES_ACTIVE:-}" ]]
[[ "$OA_UPDATE_ENABLED" == "true" ]]
[[ "$OA_UPDATE_GITEA_BASE_URL" == "http://127.0.0.1:$port" ]]
[[ "$ERP_SETUP_TOKEN" =~ ^[0-9a-f]{64}$ ]]
@@ -528,6 +528,7 @@ test_installer_requires_explicit_gitea_url() (
set --
source "$root/install.sh"
GITEA_BASE_URL=
NO_SERVICE=1
main
' _ "$PROJECT_ROOT" 2>&1)" || status=$?
[[ "$status" -ne 0 && "$output" == *'Gitea URL is required'* ]]
@@ -680,6 +681,8 @@ test_release_workflow_uses_scoped_job_token() (
grep -Fqx ' releases: write' "$workflow"
grep -Fq 'GITEA_BASE_URL: ${{ github.server_url }}' "$workflow"
grep -Fq 'GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}' "$workflow"
grep -Fq 'uses: actions/setup-java@v4' "$workflow"
grep -Fq 'java-version: "17"' "$workflow"
! grep -Fq 'RELEASE_GITEA_TOKEN' "$workflow"
! grep -Fq 'vars.GITEA_BASE_URL' "$workflow"
)