-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.67 KB
/
commons-update.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
49
50
51
52
53
54
55
56
57
58
59
60
61
on:
push:
branches: [ "main"]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 23 * * *'
permissions: read-all
env:
PYWIKIBOT_TEST_RUNNING: 1
PYWIKIBOT_USERNAME: Athulvis
PYWIKIBOT_LOGIN_LOGOUT: 1
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
python-version: ["3.10"]
site: ['commons:commons']
include:
- python-version: 3.10
site: commons:commons
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Generate user files
run: |
pwb generate_user_files -site:${{matrix.site}} -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;
echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py
echo "max_retries = 3" >> user-config.py
echo "noisysleep = float('inf')" >> user-config.py
echo "maximum_GET_length = 5000" >> user-config.py
echo "console_encoding = 'utf8'" >> user-config.py
echo "import os" >> user-config.py
echo "password_file = os.path.expanduser('passwordfile')" >> user-config.py
echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PWD }}')" > passwordfile
- name: Update Commons
timeout-minutes: 10
run: |
pwb wikiupdater