Added timeouts to await
s of isLoaded
promises for unhindered prog…
#58
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
name: Sync LICENSE.md from chrome/* to <platform>/*, then chrome/extension/* to (edge|opera)/extension/*, then chrome/extension/_locales/* to greasemonkey/_locales/*, then ./* to adamlui/chatgpt-apps/chatgpt-infinity/*, then greasemonkey/* to adamlui/userscripts/chatgpt/chatgpt-infinity/* | |
on: | |
push: | |
branches: [main] | |
paths: [chrome/**] | |
jobs: | |
build: | |
if: (github.repository == 'adamlui/chatgpt-infinity') && (github.event.commits[0].committer.username != 'kudo-sync-bot') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout adamlui/chatgpt-infinity | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.REPO_SYNC_PAT }} | |
repository: adamlui/chatgpt-infinity | |
path: adamlui/chatgpt-infinity | |
fetch-depth: 2 | |
- name: Checkout adamlui/chatgpt-apps | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.REPO_SYNC_PAT }} | |
repository: adamlui/chatgpt-apps | |
path: adamlui/chatgpt-apps | |
- name: Checkout adamlui/userscripts | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.REPO_SYNC_PAT }} | |
repository: adamlui/userscripts | |
path: adamlui/userscripts | |
- name: Sync LICENSE.md from chrome/* to <platform>/* | |
run: | | |
cd ${{ github.workspace }}/adamlui/chatgpt-infinity | |
platforms=($(find . -type d -name "docs" | # paths to docs/ | |
awk -F'/' '{print $(NF-1)}' | # filter to parents | |
grep -v "^chrome$")) # exclude chrome | |
echo "Platforms: ${platforms[@]}" | |
languages=($(ls docs/*/LICENSE.md | # paths to LICENSEs | |
awk -F'/' '{print $(NF-1)}') # filter to parents | |
"en") # include English | |
echo -e "Languages: ${languages[@]}\n" | |
for lang in "${languages[@]}"; do | |
chrome_license=./chrome$([[ "$lang" != "en" ]] && echo "/docs/$lang/" || echo "/")LICENSE.md | |
chrome_license_content=$(git show HEAD:"$chrome_license") | |
chrome_license_modified=$(git log -1 --format="%ct" -- "$chrome_license") | |
for platform in "${platforms[@]}"; do | |
platform_license=./$platform/$([[ "$lang" != "en" ]] && echo "docs/$lang/" || echo "")LICENSE.md | |
platform_license_content=$(git show HEAD:"$platform_license") | |
platform_license_modified=$(git log -1 --format="%ct" -- "$platform_license") | |
if [[ $chrome_license_modified -gt $platform_license_modified ]] ; then | |
if [[ "$chrome_license_content" != "$platform_license_content" ]] ; then | |
cp -f "$chrome_license" "$platform_license" | |
echo "Copied $chrome_license to $platform_license" | |
fi ; fi ; done; done | |
- name: Sync chrome/extension/* to (edge|opera)/extension/* | |
run: | | |
for browser in edge opera | |
do | |
rsync -avhr --delete \ | |
"${{ github.workspace }}/adamlui/chatgpt-infinity/chrome/extension/" \ | |
"${{ github.workspace }}/adamlui/chatgpt-infinity/$browser/extension" | |
done | |
- name: Sync chrome/extension/_locales/* to greasemonkey/_locales/* | |
run: | | |
rsync -avhr --delete \ | |
"${{ github.workspace }}/adamlui/chatgpt-infinity/chrome/extension/_locales/" \ | |
"${{ github.workspace }}/adamlui/chatgpt-infinity/greasemonkey/_locales" | |
- name: Sync ./* to adamlui/chatgpt-apps/chatgpt-infinity/* | |
run: | | |
rsync -avhr --delete --exclude={'.*','eslint*','package*json'} \ | |
${{ github.workspace }}/adamlui/chatgpt-infinity/ \ | |
${{ github.workspace }}/adamlui/chatgpt-apps/chatgpt-infinity/ | |
- name: Sync greasemonkey/ to adamlui/userscripts/chatgpt/chatgpt-infinity/ | |
run: | | |
rsync -avhr --delete \ | |
${{ github.workspace }}/adamlui/chatgpt-infinity/greasemonkey/ \ | |
${{ github.workspace }}/adamlui/userscripts/chatgpt/chatgpt-infinity/ | |
- name: Push to adamlui/chatgpt-infinity | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
push_options: --force | |
add_options: --all | |
commit_user_email: auto-sync@kudoai.com | |
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `chrome`]" | |
file_pattern: "**" | |
repository: adamlui/chatgpt-infinity | |
- name: Push to adamlui/chatgpt-apps | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
push_options: --force | |
add_options: --all | |
commit_user_email: auto-sync@kudoai.com | |
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `adamlui/chatgpt-infinity/chrome`]" | |
file_pattern: "chatgpt-infinity/**" | |
repository: adamlui/chatgpt-apps | |
- name: Push to adamlui/userscripts | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
push_options: --force | |
add_options: --all | |
commit_user_email: auto-sync@kudoai.com | |
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `adamlui/chatgpt-infinity`]" | |
file_pattern: "chatgpt/chatgpt-infinity/**" | |
repository: adamlui/userscripts |