-
Notifications
You must be signed in to change notification settings - Fork 13
48 lines (41 loc) · 1.88 KB
/
synchronize-launchpad.yml
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
# Copyright (C) 2005 - 2023 Settlers Freaks <sf-team at siedler25.org>
#
# SPDX-License-Identifier: GPL-2.0-or-later
name: Synchronize with Launchpad
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
apt-get -o Acquire::Retries=3 update
apt-get -o Acquire::Retries=3 install -y software-properties-common curl
# Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80
curl -sSL --retry 3 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24' | gpg --dearmor > /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg
for i in {1..3}; do add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
# Above this is a workaround only required when running in the bare ubuntu 18 container
apt-get -o Acquire::Retries=3 update
apt-get -o Acquire::Retries=3 install -y openssh-client git bzr-fastimport
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup SSH
uses: MrSquaare/ssh-setup-action@v2
with:
host: bazaar.launchpad.net
private-key: ${{ secrets.LAUNCHPAD_PRIVATE_KEY }}
- name: Copy SSH config to container root user
run: cp -rT "$SSH_PATH" "/root/.ssh"
- name: Synchronize bazaar and git
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
bzr init-repo bzr-repo
(cd "$GITHUB_WORKSPACE" && git fast-export -M --all) | (cd bzr-repo && bzr fast-import -)
- name: Login to launchpad
run: bzr launchpad-login ${{ secrets.LAUNCHPAD_USER }}
- name: Upload to launchpad
run: (cd bzr-repo/trunk ; bzr push --overwrite lp:~s25rttrteam/s25rttr/s25rttr-languages)