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
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:
@@ -32,15 +32,6 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
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
|
||||
env:
|
||||
SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
@@ -4,17 +4,15 @@ set -e
|
||||
RAW_VERSION=""
|
||||
|
||||
if [ -n "${VERSION_FILE-}" ] && [ -f "${VERSION_FILE-}" ]; then
|
||||
if echo "${VERSION_FILE}" | grep -q -E '\.[Yy][Aa][Mm][Ll]$'; then
|
||||
RAW_VERSION=$(yq '.version' "${VERSION_FILE}" 2>/dev/null | grep -v '^null$' || true)
|
||||
RAW_VERSION=$(tr -d "$(printf '\xef\xbb\xbf')" < "${VERSION_FILE}" | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
|
||||
if [ -z "${RAW_VERSION}" ]; then
|
||||
RAW_VERSION=$(sed 's/'$'\xef\xbb\xbf''//g' "${VERSION_FILE}" | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
|
||||
fi
|
||||
elif echo "${VERSION_FILE}" | grep -q -E '\.json$'; then
|
||||
if 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
|
||||
|
||||
if [ -z "${RAW_VERSION}" ]; then
|
||||
if [ -f VERSION ]; then
|
||||
@@ -24,10 +22,7 @@ if [ -z "${RAW_VERSION}" ]; then
|
||||
elif [ -f pom.xml ]; then
|
||||
RAW_VERSION=$(grep -oP '<version>\K[^<]+' pom.xml | head -1)
|
||||
elif [ -f Chart.yaml ]; then
|
||||
RAW_VERSION=$(yq '.version' Chart.yaml 2>/dev/null | grep -v '^null$' || true)
|
||||
if [ -z "${RAW_VERSION}" ]; then
|
||||
RAW_VERSION=$(sed 's/'$'\xef\xbb\xbf''//g' Chart.yaml | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
|
||||
fi
|
||||
RAW_VERSION=$(tr -d "$(printf '\xef\xbb\xbf')" < Chart.yaml | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
|
||||
else
|
||||
echo "ERROR: No version source found (VERSION_FILE, VERSION, package.json, pom.xml, Chart.yaml)" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user