music-dl/.gitlab-ci.yml

83 lines
2.5 KiB
YAML
Raw Normal View History

2018-12-29 03:07:56 +01:00
variables:
PYTHON3_32: "C:\\python38-32\\python.exe"
PYTHON3_64: "C:\\python38-64\\python.exe"
2018-12-29 18:36:57 +01:00
NSIS: "C:\\nsis\\makensis.exe"
2018-12-29 20:38:25 +01:00
2018-12-29 22:04:24 +01:00
### Stage list
# Build: This will be the main stage generating stuff in the dist folder. Jobs present in this stage will run py2exe or pyinstaller files accordingly.
# pack: Jobs in this stage will take the dist folder and zip it or generate an exe file.
2018-12-29 16:09:25 +01:00
stages:
2018-12-30 03:18:37 +01:00
- test
2018-12-29 20:49:44 +01:00
- build
- pofiles
2018-12-29 16:20:22 +01:00
.configure_environment: &configure_environment
2018-12-30 03:18:37 +01:00
tags:
- windows10
before_script:
- '&$env:PYTHON3_32 -V'
- '&$env:PYTHON3_32 -m venv env'
2020-07-19 17:31:34 +02:00
- 'env\scripts\activate'
- 'python -m pip install --upgrade pip'
2020-10-01 00:56:16 +02:00
- 'python -m pip install --upgrade -r requirements.txt'
### Updates all translation templates for weblate
update_translation_templates:
<<: *configure_environment
stage: pofiles
tags:
- windows10
script:
- 'python -m pip install --upgrade babel'
# - copy changelog.md doc\changelog.md
# - cd doc
# - '&$env:PYTHON3_32 documentation_importer.py'
- cd src
- 'python setup.py extract_messages -o ..\scripts\musicdl.pot --msgid-bugs-address "manuel@manuelcortez.net" --copyright-holder "Manuel Cortez" --input-dirs .'
2020-10-01 17:03:41 +02:00
- 'python setup.py update_catalog --input-file ..\scripts\musicdl.pot --domain musicdl --output-dir locales --ignore-obsolete true'
# - cd ..\doc
# - '&$env:PYTHON3_32 translate.py'
- cd ..
- 'git config user.name "Windows runner"'
- 'git config user.email "manuel@manuelcortez.net"'
- 'git add scripts'
2020-10-01 17:03:41 +02:00
- 'git add src\locales'
- 'git remote set-url --push origin git@code.manuelcortez.net:$env:CI_PROJECT_PATH'
- 'git commit -m "Updated locales [skip ci]"'
- 'git push origin HEAD:$env:CI_COMMIT_REF_NAME'
only:
- master
test:
<<: *configure_environment
stage: test
tags:
- windows10
script:
- cd src
- 'python -m pip install --upgrade coverage'
- 'python -m coverage run run_tests.py'
- 'python -m coverage report --omit="test*"'
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
only:
- master
- schedules
public:
<<: *configure_environment
stage: build
2018-12-29 16:09:25 +01:00
script:
2018-12-29 03:07:56 +01:00
- cd src
- 'python write_version_data.py'
- 'python setup.py build'
- '&$env:NSIS installer.nsi'
- cd ..
- move src\music_dl* .
2018-12-29 20:38:25 +01:00
- cd scripts
- 'python prepare_zipversion.py'
2018-12-29 20:38:25 +01:00
- cd ..
- move src\music_dl.zip music_dl.zip
2020-07-13 04:57:53 +02:00
- 'python scripts/generate_update_file.py'
- 'python scripts/upload.py'
only:
- master