2021-01-19 22:32:40 +01:00
|
|
|
# This CI configuration file assumes we are going to use gitlab Shared runners at gitlab.com
|
|
|
|
# due to gitlab possibilities, we use a mix of Windows and docker containers (the python image) to build the project.
|
|
|
|
# the next variables are customized to the filepaths used when installing python and nsis with chocolatey on the windows runners.
|
2018-12-29 03:07:56 +01:00
|
|
|
variables:
|
2021-01-19 22:32:40 +01:00
|
|
|
PYTHON3_32: "C:\\python38\\python.exe"
|
|
|
|
NSIS: "C:\\program files (x86)\\nsis\\makensis.exe"
|
2018-12-29 20:38:25 +01:00
|
|
|
|
2021-01-19 22:32:40 +01:00
|
|
|
# The project defines 3 stages:
|
|
|
|
# 1. Generate_docs: generates the documentation and update translation files. This uses the python docker image.
|
|
|
|
# 2. Build: Creates the executable file by using a windows runner.
|
|
|
|
# 3. Upload: Puts everything in an ftp directory. I had to use a docker container here because the Windows runner has all ports blocked.
|
2018-12-29 16:09:25 +01:00
|
|
|
stages:
|
2021-01-19 22:32:40 +01:00
|
|
|
- test
|
|
|
|
- generate_docs
|
|
|
|
- build
|
|
|
|
- upload
|
2018-12-29 16:20:22 +01:00
|
|
|
|
2021-01-19 22:32:40 +01:00
|
|
|
# This configures the environment for both channels
|
2020-07-08 00:33:09 +02:00
|
|
|
.configure_environment: &configure_environment
|
2021-01-19 22:32:40 +01:00
|
|
|
interruptible: true
|
2018-12-30 03:18:37 +01:00
|
|
|
tags:
|
2021-01-19 22:32:40 +01:00
|
|
|
- shared-windows
|
|
|
|
- windows
|
|
|
|
- windows-1809
|
2018-12-30 03:18:37 +01:00
|
|
|
before_script:
|
2021-01-19 22:32:40 +01:00
|
|
|
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
|
|
|
|
- echo ${time}
|
|
|
|
- echo "started by ${GITLAB_USER_NAME}"
|
|
|
|
- choco install python --version 3.8.7 -y -ForceX86
|
|
|
|
- choco install nsis -y -ForceX86
|
2020-07-19 18:38:07 +02:00
|
|
|
- '&$env:PYTHON3_32 -V'
|
2021-01-19 22:32:40 +01:00
|
|
|
- '&$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'
|
2020-10-01 00:48:24 +02:00
|
|
|
### Updates all translation templates for weblate
|
2021-01-19 22:32:40 +01:00
|
|
|
|
|
|
|
buildexe:
|
2020-07-08 00:33:09 +02:00
|
|
|
<<: *configure_environment
|
2018-12-29 18:31:13 +01:00
|
|
|
stage: build
|
2018-12-29 16:09:25 +01:00
|
|
|
script:
|
2018-12-29 03:07:56 +01:00
|
|
|
- cd src
|
2021-01-19 22:32:40 +01:00
|
|
|
- '&$env:PYTHON3_32 write_version_data.py'
|
|
|
|
- '&$env:PYTHON3_32 setup.py build'
|
2020-07-08 00:33:09 +02:00
|
|
|
- '&$env:NSIS installer.nsi'
|
|
|
|
- cd ..
|
2021-01-19 22:32:40 +01:00
|
|
|
- mkdir artifacts
|
|
|
|
- move src\music_dl* artifacts
|
2018-12-29 20:38:25 +01:00
|
|
|
- cd scripts
|
2021-01-19 22:32:40 +01:00
|
|
|
- '&$env:PYTHON3_32 prepare_zipversion.py'
|
2018-12-29 20:38:25 +01:00
|
|
|
- cd ..
|
2021-01-19 22:32:40 +01:00
|
|
|
- move src\music_dl.zip artifacts\music_dl.zip
|
2018-12-29 18:31:13 +01:00
|
|
|
only:
|
2021-09-23 00:24:31 +02:00
|
|
|
- schedules
|
2021-01-19 22:32:40 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- artifacts
|
|
|
|
expire_in: 1 day
|
|
|
|
|
|
|
|
upload:
|
|
|
|
stage: upload
|
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
image: python
|
|
|
|
interruptible: true
|
|
|
|
script:
|
|
|
|
- cd artifacts
|
2021-01-19 23:19:14 +01:00
|
|
|
- python ../scripts/generate_update_file.py
|
2021-01-19 22:32:40 +01:00
|
|
|
- python ../scripts/upload.py
|
|
|
|
only:
|
2021-09-23 00:24:31 +02:00
|
|
|
# - master
|
2021-01-19 22:32:40 +01:00
|
|
|
- tags
|
|
|
|
- schedules
|