From 9f749f364c4a73fef3006b8caaefdfdee979ae43 Mon Sep 17 00:00:00 2001
From: cocoatomo <cocoatomo77@gmail.com>
Date: Thu, 30 Dec 2021 16:26:03 +0900
Subject: [PATCH 1/2] [WIP] Add update.yml

---
 .github/workflows/update.yml | 42 ++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml
index 8b1378917..a3ac4af1e 100644
--- a/.github/workflows/update.yml
+++ b/.github/workflows/update.yml
@@ -1 +1,43 @@
+name: Sync po files
 
+on:
+  schedule:
+  - cron: "0 9 * * *"
+
+env:
+    # branch name of python-docs-ja repository
+    DOCS_BRANCH: "3.10"
+    # branch name of cpython repository
+    CPYTHON_BRANCH: "3.10"
+    # branch name of cpython-doc-catalog repository
+    CATALOG_BRANCH: "catalog-3.10"
+    # Transifex project name
+    TRANSIFEX_PROJECT: "python-newest"
+    # Directory where repositories are cloned
+    BASEDIR: "$(dirname ${TRAVIS_BUILD_DIR})"
+
+jobs:
+  main:
+    name: Sync po/pot fiels
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check out the repo
+      - uses: actions/checkout@v2
+        
+      - name: Setup Python
+      - uses: actions/setup-python@v2.3.1
+        with:
+          python-version: "3.10"
+          architecture: "x64"
+      
+      - name: Install packages
+        run: |
+          pip install sphinx sphinx-intl blurb trasifex-client
+      
+      - name: Run scripts
+        run: |
+          bash ${TRAVIS_BUILD_DIR}/scripts/prepare-build_3.10
+          bash ${TRAVIS_BUILD_DIR}/scripts/upload-catalog
+          bash ${TRAVIS_BUILD_DIR}/scripts/renew-catalog-template
+
+      

From 07af397bd7e22c10ecf1ac2f720284a5ee6f1e8a Mon Sep 17 00:00:00 2001
From: cocoatomo <cocoatomo77@gmail.com>
Date: Wed, 12 Jan 2022 22:17:09 +0900
Subject: [PATCH 2/2] Get rid of unnecessary files

---
 scripts/determine-build-type              | 17 -------------
 scripts/pr-merge/main.sh                  |  5 ----
 scripts/pr/main.sh                        |  5 ----
 scripts/push/main.sh                      |  6 -----
 scripts/push/prepare-build_3.10           | 31 -----------------------
 scripts/{push => }/renew-catalog-template |  0
 scripts/{push => }/upload-catalog         |  0
 7 files changed, 64 deletions(-)
 delete mode 100644 scripts/determine-build-type
 delete mode 100644 scripts/pr-merge/main.sh
 delete mode 100644 scripts/pr/main.sh
 delete mode 100644 scripts/push/main.sh
 delete mode 100644 scripts/push/prepare-build_3.10
 rename scripts/{push => }/renew-catalog-template (100%)
 rename scripts/{push => }/upload-catalog (100%)

diff --git a/scripts/determine-build-type b/scripts/determine-build-type
deleted file mode 100644
index 2a73b0ef1..000000000
--- a/scripts/determine-build-type
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-set -eux
-
-if [[ "${TRAVIS_EVENT_TYPE}" == "push" ]]; then
-  if [[ ${NUM_PARENTS} == 1 ]]; then
-    echo push
-  else
-    echo pr-merge
-  fi
-elif [[ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]]; then
-  echo pr
-elif [[ "${TRAVIS_EVENT_TYPE}" == "api" ]]; then
-  # do not build
-  echo ""
-elif [[ "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then
-  echo push
-fi
diff --git a/scripts/pr-merge/main.sh b/scripts/pr-merge/main.sh
deleted file mode 100644
index 66961baa6..000000000
--- a/scripts/pr-merge/main.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-set -eux
-
-# not yet implemented
-exit 0
diff --git a/scripts/pr/main.sh b/scripts/pr/main.sh
deleted file mode 100644
index 66961baa6..000000000
--- a/scripts/pr/main.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-set -eux
-
-# not yet implemented
-exit 0
diff --git a/scripts/push/main.sh b/scripts/push/main.sh
deleted file mode 100644
index 38eae8cc2..000000000
--- a/scripts/push/main.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-set -eux
-
-bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/prepare-build_3.10
-bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/upload-catalog
-bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/renew-catalog-template
diff --git a/scripts/push/prepare-build_3.10 b/scripts/push/prepare-build_3.10
deleted file mode 100644
index 4ee65a679..000000000
--- a/scripts/push/prepare-build_3.10
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-set -eux
-
-ls -la ${BASEDIR}
-git config --global user.email "travisci-build-bot@example.com"
-git config --global user.name "Autobuild bot on TravisCI"
-git checkout ${DOCS_BRANCH}
-
-# extract secrets
-cd ~
-openssl aes-256-cbc -K ${encryption_310_K} -iv ${encryption_310_iv} -in "${BASEDIR}/python-docs-ja/secrets_${DOCS_BRANCH}.tar.enc" -out ~/secrets_${DOCS_BRANCH}.tar -d
-tar xvf ~/secrets_${DOCS_BRANCH}.tar
-rm ~/secrets_${DOCS_BRANCH}.tar
-chmod 600 ~/.ssh/python-docs-ja_${DOCS_BRANCH}
-chmod 600 ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH}
-
-# enable using plural deploy keys for repositories
-# Hack from: https://gist.github.com/jamesmcfadden/d379e04e7ae2861414886af189ec59e5
-cat <<EOF >> ~/.ssh/config
-Host python-docs-ja.github.com
-  HostName github.com
-  IdentityFile ~/.ssh/python-docs-ja_${DOCS_BRANCH}
-  StrictHostKeyChecking no
-
-Host cpython-doc-catalog.github.com
-  HostName github.com
-  IdentityFile ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH}
-  StrictHostKeyChecking no
-EOF
-
-cat ~/.ssh/config
diff --git a/scripts/push/renew-catalog-template b/scripts/renew-catalog-template
similarity index 100%
rename from scripts/push/renew-catalog-template
rename to scripts/renew-catalog-template
diff --git a/scripts/push/upload-catalog b/scripts/upload-catalog
similarity index 100%
rename from scripts/push/upload-catalog
rename to scripts/upload-catalog
