Moved project to our own runner

This commit is contained in:
Manuel Cortez 2021-12-29 10:51:40 -06:00
parent af16329c72
commit 236539f337
No known key found for this signature in database
GPG Key ID: 262CC30FA01B5CBF

View File

@ -1,56 +1,45 @@
# 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.
variables: variables:
PYTHON3_32: "C:\\python38\\python.exe" PYTHON3_32: "C:\\python38\\python.exe"
NSIS: "C:\\program files (x86)\\nsis\\makensis.exe" NSIS: "C:\\program files (x86)\\nsis\\makensis.exe"
# 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.
stages: stages:
- test - test
- generate_docs - generate_docs
- build - build
- upload - upload
# This configures the environment for both channels program32:
.configure_environment: &configure_environment
interruptible: true interruptible: true
tags: tags:
- shared-windows
- windows - windows
- windows-1809 - windows10
stage: build
variables:
PYTHON: "C:\\python37-32\\python.exe"
before_script: before_script:
- Set-Variable -Name "time" -Value (date -Format "%H:%m") - Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time} - echo ${time}
- echo "started by ${GITLAB_USER_NAME}" - echo "started by ${GITLAB_USER_NAME}"
- choco install python --version 3.8.7 -y -ForceX86 - '&$env:PYTHON -V'
- choco install nsis -y -ForceX86 - '&$env:PYTHON -m pip install --upgrade pip'
- '&$env:PYTHON3_32 -V' - '&$env:PYTHON -m venv env'
- '&$env:PYTHON3_32 -m pip install --upgrade pip' - 'env\Scripts\Activate.ps1'
- '&$env:PYTHON3_32 -m pip install --upgrade -r requirements.txt' - 'python -m pip install --upgrade -r requirements.txt'
- '&$env:PYTHON3_32 -m pip uninstall enum34 -y'
### Updates all translation templates for weblate
buildexe:
<<: *configure_environment
stage: build
script: script:
- cd src - cd src
- '&$env:PYTHON3_32 write_version_data.py' - 'python write_version_data.py'
- '&$env:PYTHON3_32 setup.py build' - 'python setup.py build'
- '&$env:NSIS installer.nsi' - '&$env:NSIS installer.nsi'
- cd .. - cd ..
- mkdir artifacts - mkdir artifacts
- move src\music_dl* artifacts - move src\music_dl* artifacts
- cd scripts - cd scripts
- '&$env:PYTHON3_32 prepare_zipversion.py' - 'python prepare_zipversion.py'
- cd .. - cd ..
- move src\music_dl.zip artifacts\music_dl.zip - move src\music_dl.zip artifacts\music_dl.zip
only: only:
- schedules - schedules
- master
artifacts: artifacts:
paths: paths:
- artifacts - artifacts
@ -67,6 +56,6 @@ upload:
- python ../scripts/generate_update_file.py - python ../scripts/generate_update_file.py
- python ../scripts/upload.py - python ../scripts/upload.py
only: only:
# - master - master
- tags - tags
- schedules - schedules