diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58ab53f..0a3ff9a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,14 @@ # This CI configuration file assumes we are going to use gitlab Shared runners at gitlab.com -# the next variables are customized to the filepaths used when installing python and nsis with chocolatey. +# 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: PYTHON3_32: "C:\\python38\\python.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: - generate_docs - build @@ -114,7 +119,6 @@ alpha32: - artifacts expire_in: 1 day - # Generates a new stable version of the application every tag. stable: <<: *configure_environment @@ -129,12 +133,16 @@ stable: - '&$env:PYTHON3_32 setup.py build' - '&$env:NSIS installer.nsi' - cd .. - - move src\socializer* . + - mkdir artifacts + - move src\socializer* artifacts\ - cd scripts - '&$env:PYTHON3_32 prepare_zipversion.py' - cd .. - - move src\socializer.zip socializer_x86.zip - - '&$env:PYTHON3_32 scripts/upload.py' + - move src\socializer.zip artifacts\socializer_x86.zip + artifacts: + paths: + - artifacts + expire_in: 1 day only: - tags diff --git a/scripts/generate_update_file.py b/scripts/generate_update_file.py index 6d8b916..916f959 100644 --- a/scripts/generate_update_file.py +++ b/scripts/generate_update_file.py @@ -14,11 +14,11 @@ print("Version detected: %s" % (version_type,)) # Read update description and URL'S if version_type == "alpha": description = os.environ.get("CI_COMMIT_MESSAGE") - urls = dict(Windows32="http://socializer.su/static/files/alpha/socializer_x86_alpha.zip", Windows64="http://socializer.su/static/files/alpha/socializer_x64_alpha.zip") + urls = dict(Windows32="https://files.manuelcortez.net/socializer/alpha/socializer_x86_alpha.zip", Windows64="https://files.manuelcortez.net/socializer/alpha/socializer_x64_alpha.zip") else: with open("update-description",'r') as f: description = f.read() - urls=dict(Windows32="http://socializer.su/static/files/{v}/socializer_{v}_x86.zip".format(v=version[1:]), Windows64="http://socializer.su/static/files/{v}/socializer_{v}_x64.zip".format(v=version[1:])) + urls=dict(Windows32="https://files.manuelcortez.net/socializer/{v}/socializer_{v}_x86.zip".format(v=version[1:]), Windows64="https://files.manuelcortez.net/socializer/{v}/socializer_{v}_x64.zip".format(v=version[1:])) # build the main dict object data = dict(current_version=version, description=description, downloads=urls)