fix(gitea): ensure python runtime for deploy update job
This commit is contained in:
@@ -236,6 +236,40 @@ jobs:
|
||||
pr_url: ${{ steps.create_pr.outputs.pr_url }}
|
||||
|
||||
steps:
|
||||
- name: Ensure Python runtime
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if command -v python3 >/dev/null 2>&1; then
|
||||
:
|
||||
elif command -v python >/dev/null 2>&1; then
|
||||
ln -sf "$(command -v python)" /usr/local/bin/python3
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache python3 py3-pip
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update
|
||||
apt-get install -y python3 python3-pip
|
||||
else
|
||||
echo "No supported package manager found to install python3" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! python3 -m pip --version >/dev/null 2>&1; then
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache py3-pip
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update
|
||||
apt-get install -y python3-pip
|
||||
else
|
||||
echo "python3 exists but pip is unavailable" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
python3 --version
|
||||
python3 -m pip --version
|
||||
|
||||
- name: Install PyYAML
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user