Update from sources #77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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, fix/** ] | |
| workflow_dispatch: | |
| jobs: | |
| upload: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -V | |
| venv_dir="/tmp/venv" | |
| python -m venv "$venv_dir" | |
| . $venv_dir/bin/activate | |
| echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> "$GITHUB_ENV" | |
| echo "$venv_dir/bin" >> "$GITHUB_PATH" | |
| # Use a pip version that still allows the legacy installation for this breezy version | |
| # Use a Cython still having e.g. cpython/int.pxd (Python 2.x legacy) | |
| pip install 'pip<23.1' 'Cython<3.1' configobj | |
| pip install 'breezy[fastimport,git,launchpad]<3.3' # 3.3+ requires interactive login | |
| fastimport_dir=$venv_dir/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 | |
| if: ${{ github.ref_name == 'master' }} | |
| uses: MrSquaare/ssh-setup-action@v3 | |
| with: | |
| host: bazaar.launchpad.net | |
| private-key: ${{ secrets.LAUNCHPAD_PRIVATE_KEY }} | |
| - name: Synchronize bazaar and git | |
| if: ${{ github.ref_name == 'master' }} | |
| run: | | |
| brz init-repo bzr-repo | |
| (cd "$GITHUB_WORKSPACE" && git fast-export -M --all) | (cd bzr-repo && brz fast-import -) | |
| - name: Login to launchpad | |
| if: ${{ github.ref_name == 'master' }} | |
| run: brz launchpad-login ${{ secrets.LAUNCHPAD_USER }} | |
| - name: Upload to launchpad | |
| if: ${{ github.ref_name == 'master' }} | |
| working-directory: bzr-repo/trunk | |
| run: brz push --overwrite lp:~s25rttrteam/s25rttr/s25rttr-languages |