fragine test fix
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m18s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 2m2s
CI Feature / Report Summary (push) Successful in 5s

This commit is contained in:
moilanik
2026-06-19 13:09:30 +03:00
parent 45f939a611
commit 272d59e062
2 changed files with 7 additions and 21 deletions
-9
View File
@@ -32,15 +32,6 @@ jobs:
repository: niko/gitea-ci-library repository: niko/gitea-ci-library
path: .ci path: .ci
- name: Install yq
# COMPROMISE: Requires internet access.
# Does NOT work in air-gapped environments. The script falls back
# to BOM-stripping sed if yq is not available.
run: |
if ! command -v yq &>/dev/null; then
sudo apt-get update -qq && sudo apt-get install -y -qq yq
fi
- name: Check existing artifact and calculate version - name: Check existing artifact and calculate version
env: env:
SERVER_URL: ${{ gitea.server_url }} SERVER_URL: ${{ gitea.server_url }}
+7 -12
View File
@@ -4,15 +4,13 @@ set -e
RAW_VERSION="" RAW_VERSION=""
if [ -n "${VERSION_FILE-}" ] && [ -f "${VERSION_FILE-}" ]; then if [ -n "${VERSION_FILE-}" ] && [ -f "${VERSION_FILE-}" ]; then
if echo "${VERSION_FILE}" | grep -q -E '\.[Yy][Aa][Mm][Ll]$'; then RAW_VERSION=$(tr -d "$(printf '\xef\xbb\xbf')" < "${VERSION_FILE}" | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
RAW_VERSION=$(yq '.version' "${VERSION_FILE}" 2>/dev/null | grep -v '^null$' || true) if [ -z "${RAW_VERSION}" ]; then
if [ -z "${RAW_VERSION}" ]; then if echo "${VERSION_FILE}" | grep -q -E '\.json$'; then
RAW_VERSION=$(sed 's/'$'\xef\xbb\xbf''//g' "${VERSION_FILE}" | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p') RAW_VERSION=$(jq -r '.version' "${VERSION_FILE}")
else
RAW_VERSION=$(cat "${VERSION_FILE}" | tr -d '[:space:]')
fi fi
elif echo "${VERSION_FILE}" | grep -q -E '\.json$'; then
RAW_VERSION=$(jq -r '.version' "${VERSION_FILE}")
else
RAW_VERSION=$(cat "${VERSION_FILE}" | tr -d '[:space:]')
fi fi
fi fi
@@ -24,10 +22,7 @@ if [ -z "${RAW_VERSION}" ]; then
elif [ -f pom.xml ]; then elif [ -f pom.xml ]; then
RAW_VERSION=$(grep -oP '<version>\K[^<]+' pom.xml | head -1) RAW_VERSION=$(grep -oP '<version>\K[^<]+' pom.xml | head -1)
elif [ -f Chart.yaml ]; then elif [ -f Chart.yaml ]; then
RAW_VERSION=$(yq '.version' Chart.yaml 2>/dev/null | grep -v '^null$' || true) RAW_VERSION=$(tr -d "$(printf '\xef\xbb\xbf')" < Chart.yaml | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
if [ -z "${RAW_VERSION}" ]; then
RAW_VERSION=$(sed 's/'$'\xef\xbb\xbf''//g' Chart.yaml | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
fi
else else
echo "ERROR: No version source found (VERSION_FILE, VERSION, package.json, pom.xml, Chart.yaml)" >&2 echo "ERROR: No version source found (VERSION_FILE, VERSION, package.json, pom.xml, Chart.yaml)" >&2
exit 1 exit 1