Update synchronize-launchpad.yml #45
This file contains 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 - 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) |