diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..2307c94 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,77 @@ +environment: + global: + PYTHON: "C:\\Python36-x64" + matrix: + - ARCH: "OpenCLSSE" + - ARCH: "CUDA9.2SSE" + - ARCH: "CUDA10.1SSE" + - ARCH: "CUDA10.1AVX" + + +version: '{branch}-{build}' + +#os: Visual Studio 2015 + +## build cache to preserve files/folders between builds +#cache: +# - packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified +# - projectA\libs +# - node_modules # local npm modules +# - '%LocalAppData%\NuGet\Cache' # NuGet < v3 +# - '%LocalAppData%\NuGet\v3-cache' # NuGet v3 + +install: + - cmd: SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%" + - cmd: For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) + - cmd: set ARCHIVE_NAME=DeepFaceLab-%ARCH%-%mydate%-BUILD-%APPVEYOR_BUILD_NUMBER% + - cmd: echo %ARCHIVE_NAME% + - ps: python --version + - ps: python -m pip install --upgrade pip + - ps: python -m pip install -r appveyor/requirements.txt + - cmd: cd .. + - cmd: python deepfacelab\appveyor\gdrive.py %ARCH% > Output + - cmd: set /p URL= nul + - cmd: dir + - cmd: dir .\deepfacelab + - cmd: dir .\DeepFaceLab%ARCH%\_internal\DeepFaceLab + - cmd: rmdir /q/ s .\DeepFaceLab%ARCH%\_internal\DeepFaceLab + - cmd: xcopy .\deepfacelab .\DeepFaceLab%ARCH%\_internal\DeepFaceLab\ /Y /O /X /E /H /K + - cmd: dir .\DeepFaceLab%ARCH%\_internal + - cmd: dir .\DeepFaceLab%ARCH%\_internal\DeepFaceLab + - cmd: 7z a .\deepfacelab\%ARCHIVE_NAME%.7z -tzip -mx=1 -r DeepFaceLab%ARCH%\ + - cmd: dir + +build: false + +#test_script: +# # Put your test command here. +# - test + +#after_test: +# after test + +artifacts: + - path: .\%ARCHIVE_NAME%.7z + +#on_success: +# You can use this step to upload your artifacts to a public website. +# See Appveyor's documentation for more details. Or you can simply +# access your wheels from the Appveyor "artifacts" tab for your build. + +#---------------------------------# +# deployment configuration # +#---------------------------------# + +# providers: Local, FTP, WebDeploy, AzureCS, AzureBlob, S3, NuGet, Environment +# provider names are case-sensitive! +#deploy: +# # Deploy to GitHub Releases +# - provider: GitHub +# artifact: /.*\.nupkg/ # upload all NuGet packages to release assets +# draft: false +# prerelease: false +# on: +# branch: master # release from master branch only +# APPVEYOR_REPO_TAG: true # deploy on tag push only diff --git a/appveyor/gdrive.py b/appveyor/gdrive.py new file mode 100644 index 0000000..af49ee7 --- /dev/null +++ b/appveyor/gdrive.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +import sys +from operator import itemgetter +import requests +import re +import datetime +import os + +FOLDER_ID = os.environ['FOLDER_ID'] +API_KEY = os.environ['API_KEY'] + +p = re.compile(r'DeepFaceLab([\w.]+)_build_(\d\d)_(\d\d)_(\d\d\d\d)\.exe') + + +def get_folder_url(folder_id): + return "https://www.googleapis.com/drive/v3/files?q='" + folder_id + "'+in+parents&key=" + API_KEY + + +def get_builds(): + url = get_folder_url(FOLDER_ID) + r = requests.get(url) + files = r.json()['files'] + builds = [] + for file in files: + if file['mimeType'] == 'application/x-msdownload': + filename = file['name'] + m = p.match(filename) + if m: + file['arch'], month, day, year = m.groups() + file['date'] = datetime.date(int(year), int(month), int(day)) + builds.append(file) + else: + # print('Not parsed: ', filename) + pass + return builds + + +def get_latest_build(arch): + builds = get_builds() + arch_builds = [build for build in builds if build['arch'] == arch] + arch_builds.sort(key=itemgetter('date')) + return arch_builds[-1] + + +def get_download_url(file_id): + return "https://www.googleapis.com/drive/v3/files/" + file_id + "?alt=media&key=" + API_KEY + + +def main(): + arch = sys.argv[1] + # print(arch) + latest_build = get_latest_build(arch) + # print(latest_build) + download_url = get_download_url(latest_build['id']) + print(download_url) + + +if __name__ == "__main__": + main() diff --git a/appveyor/requirements.txt b/appveyor/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/appveyor/requirements.txt @@ -0,0 +1 @@ +requests