Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f2ea26e8e | ||
|
|
e295ad8b96 | ||
|
|
99b8126b59 | ||
|
|
b472581622 |
@@ -25,6 +25,12 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Java 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
|
||||
- name: Build, sign, and publish release
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -3,7 +3,7 @@ set -Eeuo pipefail
|
||||
|
||||
GITEA_BASE_URL="http://38.76.196.225:10099"
|
||||
REPOSITORY="awaioi/ERP"
|
||||
VERSION="0.3.1"
|
||||
VERSION="0.3.4"
|
||||
TAG="v${VERSION}"
|
||||
INSTALL_SHA256="89a3c45e76f500c9475cb596ea29e3518bfafdc59f36dd3c7b316ed3cdd0448c"
|
||||
UNINSTALL_SHA256="98c56fed2fd4d01874e4ab5a1a4f3ec42ec3e29b315ffd87385a95488d587546"
|
||||
|
||||
+28
-3
@@ -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 \
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user