Skip to content

Use extra step for setting up venv #61

Use extra step for setting up venv

Use extra step for setting up venv #61

# Copyright (C) 2005 - 2025 Settlers Freaks <sf-team at siedler25.org>
#
# SPDX-License-Identifier: GPL-2.0-or-later
name: Synchronize with Launchpad
on:
push:
branches: [ master, test ]
workflow_dispatch:
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup virtualenv
run: |
venv_dir="/tmp/venv"
python -m venv "$venv_dir"
echo "VIRTUAL_ENV=$venv_dir" >> "$GITHUB_ENV"
echo "$venv_dir/bin" >> "$GITHUB_PATH"
- name: Install breezy
run: |
which pip && which python
pip install --upgrade pip
pip list
pip install Cython configobj
pip install 'breezy[fastimport,git,launchpad]<3.3' # 3.3+ requires interactive login
fastimport_dir=$VIRTUAL_ENV/lib/python*/site-packages/breezy/plugins/fastimport
# Add missing import and use binary buffer of stdin for Python3 compat
sed -i '1 i from breezy import controldir' $fastimport_dir/branch_updater.py
sed -i 's/helpers.binary_stream(sys.stdin)/sys.stdin.buffer/' $fastimport_dir/cmds.py
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v3
with:
host: bazaar.launchpad.net
private-key: ${{ secrets.LAUNCHPAD_PRIVATE_KEY }}
- name: Synchronize bazaar and git
run: |
brz init-repo bzr-repo
(cd "$GITHUB_WORKSPACE" && git fast-export -M --all) | (cd bzr-repo && bzr fast-import -)
- name: Login to launchpad
run: brz launchpad-login ${{ secrets.LAUNCHPAD_USER }}
- name: Upload to launchpad
working-directory: bzr-repo/trunk
run: brz push --overwrite lp:~s25rttrteam/s25rttr/s25rttr-languages