.gitlab-ci.yml 3.94 KB
Newer Older
1
# Jobs to build the two channels in Socializer.
Manuel Cortez's avatar
Manuel Cortez committed
2
# Currently using python 3.7.7
3
variables:
Manuel Cortez's avatar
Manuel Cortez committed
4 5
  PYTHON3_32: "C:\\python37-32\\python.exe"
  PYTHON3_64: "C:\\python37-64\\python.exe"
Manuel Cortez's avatar
Manuel Cortez committed
6
  NSIS: "C:\\nsis\\makensis.exe"
7

Manuel Cortez's avatar
Manuel Cortez committed
8
.configure_environment: &configure_environment
9 10 11
  tags:
    - windows10
  before_script:
Manuel Cortez's avatar
Manuel Cortez committed
12 13 14 15
    - '&$env:PYTHON3_32 -V'
    - '&$env:PYTHON3_32 -m pip install --upgrade pip'
    - '&$env:PYTHON3_32 -m pip install --upgrade -r requirements.txt'
    - '&$env:PYTHON3_32 -m pip uninstall enum34 -y'
Manuel Cortez's avatar
Manuel Cortez committed
16

17 18
# Create documentation in all available languages so we'll have it at http://socializer.su/documentation
# this job is triggered on every commit to master, so we always will display the latest available version of the documentation in the website.
Manuel Cortez's avatar
Test  
Manuel Cortez committed
19 20
documentation:
  type: deploy
Manuel Cortez's avatar
Manuel Cortez committed
21 22
  tags:
    - windows10
Manuel Cortez's avatar
Test  
Manuel Cortez committed
23
  script:
24
    ### Dependencies.
Manuel Cortez's avatar
Manuel Cortez committed
25
    - '&$env:PYTHON3_32 -m pip install --upgrade babel markdown'
Manuel Cortez's avatar
Manuel Cortez committed
26
    # generate all html documents first.
Manuel Cortez's avatar
Test  
Manuel Cortez committed
27 28
    - copy changelog.md doc\changelog.md
    - cd doc
Manuel Cortez's avatar
Manuel Cortez committed
29
    - '&$env:PYTHON3_32 documentation_importer.py'
Manuel Cortez's avatar
Test  
Manuel Cortez committed
30
    - cd ..\src
Manuel Cortez's avatar
Manuel Cortez committed
31
    - '&$env:PYTHON3_32 ..\doc\generator.py'
Manuel Cortez's avatar
Test 4  
Manuel Cortez committed
32
    - 'move documentation ..\'
Manuel Cortez's avatar
Manuel Cortez committed
33
    # Update interface and documentation translation catalogs.
Manuel Cortez's avatar
Manuel Cortez committed
34 35
    - '&$env:PYTHON3_32 setup.py extract_messages -F babel.cfg --input-dirs . --output-file socializer.pot'
    - '&$env:PYTHON3_32 setup.py update_catalog --no-fuzzy-matching --domain socializer --output-dir locales --input-file socializer.pot'
Manuel Cortez's avatar
Manuel Cortez committed
36 37 38
    - cd ..\doc
    - '&$env:PYTHON3_32 translate.py'
    - cd ..\src
Manuel Cortez's avatar
Manuel Cortez committed
39
    - 'move locales ..\'
Manuel Cortez's avatar
Test  
Manuel Cortez committed
40 41 42 43 44
  only:
    - master
  artifacts:
    paths:
    - documentation
Manuel Cortez's avatar
Manuel Cortez committed
45
    - locales
Manuel Cortez's avatar
Test  
Manuel Cortez committed
46
    name: socializer_documentation
47
    expire_in: 30 days
Manuel Cortez's avatar
Test  
Manuel Cortez committed
48

49 50
### Updates all translation templates for weblate
update_translation_templates:
51 52 53 54
  type: deploy
  tags:
    - windows10
  script:
Manuel Cortez's avatar
Manuel Cortez committed
55
    - '&$env:PYTHON3_32 -m pip install --upgrade babel'
56 57 58 59 60
    - copy changelog.md doc\changelog.md
    - cd doc
    - '&$env:PYTHON3_32 documentation_importer.py'
    - cd ..\src
    - '&$env:PYTHON3_32 setup.py extract_messages -F babel.cfg --input-dirs . --output-file ..\scripts\socializer.pot'
61
    - '&$env:PYTHON3_32 setup.py update_catalog --no-fuzzy-matching --domain socializer --output-dir locales --input-file ..\scripts\socializer.pot'
62 63 64
    - cd ..\doc
    - '&$env:PYTHON3_32 translate.py'
    - cd ..
65 66
    - 'git config user.name "Windows runner"'
    - 'git config  user.email "manuel@manuelcortez.net"'
67
    - 'git add scripts'
68
    - 'git add src\locales'
Manuel Cortez's avatar
Manuel Cortez committed
69
    - 'git remote set-url --push origin git@code.manuelcortez.net:$env:CI_PROJECT_PATH'
Manuel Cortez's avatar
Manuel Cortez committed
70
    - 'git commit -m "Updated locales [skip ci]"'
Manuel Cortez's avatar
Manuel Cortez committed
71
    - 'git push origin HEAD:$env:CI_COMMIT_REF_NAME'
72
  only:
73
    - master
74

75
alpha32:
Manuel Cortez's avatar
Manuel Cortez committed
76
  <<: *configure_environment
77 78 79 80
  type: deploy
  script:
    - copy changelog.md doc\changelog.md
    - cd doc
Manuel Cortez's avatar
Manuel Cortez committed
81
    - '&$env:PYTHON3_32 documentation_importer.py'
82
    - cd ..\src
Manuel Cortez's avatar
Manuel Cortez committed
83 84 85 86
    - '&$env:PYTHON3_32 ..\doc\generator.py'
    - '&$env:PYTHON3_32 write_version_data.py'
    - '&$env:PYTHON3_32 setup.py build'
    - '&$env:NSIS installer_alpha.nsi'
87
    - cd ..
88
    - move src\socializer* .
Manuel Cortez's avatar
Manuel Cortez committed
89
    - cd scripts
Manuel Cortez's avatar
Manuel Cortez committed
90
    - '&$env:PYTHON3_32 prepare_zipversion.py'
91
    - cd ..
92
    - move src\socializer.zip socializer_x86_alpha.zip
Manuel Cortez's avatar
Manuel Cortez committed
93 94
    - '&$env:PYTHON3_32 scripts/generate_update_file.py'
    - '&$env:PYTHON3_32 scripts/upload.py'
95
    - move socializer_x86_alpha.zip socializer_x86.zip
96
  only:
Manuel Cortez's avatar
Manuel Cortez committed
97
    - master
98

99
# Generates a new stable version of the application every tag.
100
stable:
Manuel Cortez's avatar
Manuel Cortez committed
101
  <<: *configure_environment
Manuel Cortez's avatar
Manuel Cortez committed
102 103
  type: deploy
  script:
104
    - copy changelog.md doc\changelog.md
Manuel Cortez's avatar
Manuel Cortez committed
105
    - cd doc
Manuel Cortez's avatar
Manuel Cortez committed
106
    - '&$env:PYTHON3_32 documentation_importer.py'
Manuel Cortez's avatar
Manuel Cortez committed
107
    - cd ..\src
Manuel Cortez's avatar
Manuel Cortez committed
108 109 110 111
    - '&$env:PYTHON3_32 ..\doc\generator.py'
    - '&$env:PYTHON3_32 write_version_data.py'
    - '&$env:PYTHON3_32 setup.py build'
    - '&$env:NSIS installer.nsi'
Manuel Cortez's avatar
Manuel Cortez committed
112
    - cd ..
Manuel Cortez's avatar
Manuel Cortez committed
113
    - move src\socializer* .
Manuel Cortez's avatar
Manuel Cortez committed
114
    - cd scripts
115
    - '&$env:PYTHON3_32 prepare_zipversion.py'
Manuel Cortez's avatar
Manuel Cortez committed
116
    - cd ..
117
    - move src\socializer.zip socializer_x86.zip
Manuel Cortez's avatar
Manuel Cortez committed
118
    - '&$env:PYTHON3_32 scripts/upload.py'
119
  only:
120
    - tags