-
Notifications
You must be signed in to change notification settings - Fork 23
65 lines (56 loc) · 2.24 KB
/
synchronize-launchpad.yml
File metadata and controls
65 lines (56 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 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
# Sanity check
which brz
cat $(which brz)
brz --help
- 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