Improve pip installation: Add curl/wget fallback and ensure PATH in all steps
This commit is contained in:
@@ -25,12 +25,21 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
run: |
|
run: |
|
||||||
python3 --version
|
python3 --version
|
||||||
# Install pip if not available (without sudo)
|
# Add user bin to PATH for all steps
|
||||||
if ! command -v pip3 &> /dev/null && ! python3 -m pip --version &> /dev/null; then
|
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV
|
||||||
curl -sS https://bootstrap.pypa.io/get-pip.py | python3
|
|
||||||
fi
|
|
||||||
# Add user bin to PATH
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
# Install pip if not available (without sudo)
|
||||||
|
if ! command -v pip3 &> /dev/null 2>&1 && ! python3 -m pip --version &> /dev/null 2>&1; then
|
||||||
|
# Try curl first, then wget
|
||||||
|
if command -v curl &> /dev/null; then
|
||||||
|
curl -sS https://bootstrap.pypa.io/get-pip.py | python3
|
||||||
|
elif command -v wget &> /dev/null; then
|
||||||
|
wget -qO- https://bootstrap.pypa.io/get-pip.py | python3
|
||||||
|
else
|
||||||
|
echo "Error: Neither curl nor wget available"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
python3 -m pip install --upgrade pip --user
|
python3 -m pip install --upgrade pip --user
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -41,12 +50,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Run update script
|
- name: Run update script
|
||||||
run: |
|
run: |
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
python3 update_laws.py
|
python3 update_laws.py
|
||||||
continue-on-error: true # Weiterlaufen auch bei Fehlern
|
continue-on-error: true # Weiterlaufen auch bei Fehlern
|
||||||
|
|
||||||
- name: Convert XML to Markdown
|
- name: Convert XML to Markdown
|
||||||
if: success() || failure() # Immer ausführen, auch wenn Update fehlschlug
|
if: success() || failure() # Immer ausführen, auch wenn Update fehlschlug
|
||||||
run: |
|
run: |
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
python3 xml_to_markdown.py --prod || echo "Konvertierung fehlgeschlagen oder keine Änderungen"
|
python3 xml_to_markdown.py --prod || echo "Konvertierung fehlgeschlagen oder keine Änderungen"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user