music-dl/.gitlab-ci.yml

62 lines
1.8 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
2020-07-19 14:10:55 +02:00
default:
image: python:3.8.4-windowsservercore
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
2018-12-29 20:38:25 +01:00
- pack
2018-12-29 16:20:22 +01:00
.configure_environment: &configure_environment
2018-12-30 03:18:37 +01:00
tags:
- windows10
before_script:
2020-07-19 14:44:42 +02:00
- '$ProgressPreference = "SilentlyContinue"'
2020-07-19 14:10:55 +02:00
- 'Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/git-for-windows/git/releases/download/v2.27.0.windows.1/Git-2.27.0-32-bit.exe" -OutFile "git_setup.exe"'
2020-07-19 14:21:50 +02:00
- '.\git_setup.exe /verysilent /dir=C:\git'
2020-07-19 15:05:00 +02:00
- '$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";C:\git\cmd\;" + [System.Environment]::GetEnvironmentVariable("Path","User") '
2020-07-19 14:44:42 +02:00
- '$env:PATH'
2020-07-19 14:10:55 +02:00
- 'python -V'
# - '&$env:PYTHON3_32 -m venv env'
# - 'env\scripts\activate'
- 'python -m pip install --upgrade pip'
- 'python -m pip install --upgrade -r requirements.txt'
test:
<<: *configure_environment
stage: test
tags:
- windows10
2018-12-30 03:18:37 +01:00
script:
- cd src
- 'python -m coverage run run_tests.py'
- 'python -m coverage report --omit="test*"'
2018-12-30 06:52:24 +01:00
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
2018-12-30 03:18:37 +01:00
only:
- master
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