summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-07-13 21:34:40 -0400
committerGravatar Zach Hilman2019-07-13 21:34:40 -0400
commitbbc5b5d62dfd66e623494bfc67fc469eae6551c6 (patch)
treec0d52e7abea8f65b33e1016a31495205eb8b8c1c
parentMerge pull request #2609 from FernandoS27/new-scan (diff)
downloadyuzu-bbc5b5d62dfd66e623494bfc67fc469eae6551c6.tar.gz
yuzu-bbc5b5d62dfd66e623494bfc67fc469eae6551c6.tar.xz
yuzu-bbc5b5d62dfd66e623494bfc67fc469eae6551c6.zip
Finalize Azure Pipelines Definitions
d
-rw-r--r--.ci/scripts/.gitkeep0
-rw-r--r--.ci/scripts/common/post-upload.sh15
-rw-r--r--.ci/scripts/common/pre-upload.sh6
-rw-r--r--.ci/scripts/format/docker.sh6
-rw-r--r--.ci/scripts/format/exec.sh4
-rw-r--r--.ci/scripts/format/script.sh37
-rw-r--r--.ci/scripts/linux/docker.sh14
-rw-r--r--.ci/scripts/linux/exec.sh5
-rw-r--r--.ci/scripts/linux/upload.sh14
-rw-r--r--.ci/scripts/merge/apply-patches-by-label.py28
-rw-r--r--.ci/scripts/merge/check-label-presence.py18
-rw-r--r--.ci/scripts/merge/yuzubot-git-config.sh2
-rw-r--r--.ci/scripts/windows/docker.sh50
-rw-r--r--.ci/scripts/windows/exec.sh5
-rw-r--r--.ci/scripts/windows/scan_dll.py106
-rw-r--r--.ci/scripts/windows/upload.sh13
-rw-r--r--.ci/templates/build-single.yml21
-rw-r--r--.ci/templates/build-standard.yml22
-rw-r--r--.ci/templates/build-testing.yml30
-rw-r--r--.ci/templates/format-check.yml14
-rw-r--r--.ci/templates/merge.yml46
-rw-r--r--.ci/templates/mergebot.yml15
-rw-r--r--.ci/templates/release.yml29
-rw-r--r--.ci/templates/retrieve-artifact-source.yml16
-rw-r--r--.ci/templates/retrieve-master-source.yml11
-rw-r--r--.ci/templates/sync-source.yml7
-rw-r--r--.ci/yuzu-mainline.yml36
-rw-r--r--.ci/yuzu-verify.yml18
-rw-r--r--.ci/yuzu.yml19
29 files changed, 572 insertions, 35 deletions
diff --git a/.ci/scripts/.gitkeep b/.ci/scripts/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/.ci/scripts/.gitkeep
+++ /dev/null
diff --git a/.ci/scripts/common/post-upload.sh b/.ci/scripts/common/post-upload.sh
new file mode 100644
index 000000000..bb4e9d328
--- /dev/null
+++ b/.ci/scripts/common/post-upload.sh
@@ -0,0 +1,15 @@
1#!/bin/bash -ex
2
3# Copy documentation
4cp license.txt "$REV_NAME"
5cp README.md "$REV_NAME"
6
7tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME"
8
9mv "$REV_NAME" $RELEASE_NAME
10
117z a "$REV_NAME.7z" $RELEASE_NAME
12
13# move the compiled archive into the artifacts directory to be uploaded by travis releases
14mv "$ARCHIVE_NAME" artifacts/
15mv "$REV_NAME.7z" artifacts/
diff --git a/.ci/scripts/common/pre-upload.sh b/.ci/scripts/common/pre-upload.sh
new file mode 100644
index 000000000..3c2fc79a2
--- /dev/null
+++ b/.ci/scripts/common/pre-upload.sh
@@ -0,0 +1,6 @@
1#!/bin/bash -ex
2
3GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
4GITREV="`git show -s --format='%h'`"
5
6mkdir -p artifacts
diff --git a/.ci/scripts/format/docker.sh b/.ci/scripts/format/docker.sh
new file mode 100644
index 000000000..778411e4a
--- /dev/null
+++ b/.ci/scripts/format/docker.sh
@@ -0,0 +1,6 @@
1#!/bin/bash -ex
2
3# Run clang-format
4cd /yuzu
5chmod a+x ./.ci/scripts/format/script.sh
6./.ci/scripts/format/script.sh
diff --git a/.ci/scripts/format/exec.sh b/.ci/scripts/format/exec.sh
new file mode 100644
index 000000000..5d6393b38
--- /dev/null
+++ b/.ci/scripts/format/exec.sh
@@ -0,0 +1,4 @@
1#!/bin/bash -ex
2
3chmod a+x ./.ci/scripts/format/docker.sh
4docker run -v $(pwd):/yuzu yuzuemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.ci/scripts/format/docker.sh
diff --git a/.ci/scripts/format/script.sh b/.ci/scripts/format/script.sh
new file mode 100644
index 000000000..5ab828d5e
--- /dev/null
+++ b/.ci/scripts/format/script.sh
@@ -0,0 +1,37 @@
1#!/bin/bash -ex
2
3if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
4 dist/*.svg dist/*.xml; then
5 echo Trailing whitespace found, aborting
6 exit 1
7fi
8
9# Default clang-format points to default 3.5 version one
10CLANG_FORMAT=clang-format-6.0
11$CLANG_FORMAT --version
12
13if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then
14 # Get list of every file modified in this pull request
15 files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)"
16else
17 # Check everything for branch pushes
18 files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
19fi
20
21# Turn off tracing for this because it's too verbose
22set +x
23
24for f in $files_to_lint; do
25 d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true)
26 if ! [ -z "$d" ]; then
27 echo "!!! $f not compliant to coding style, here is the fix:"
28 echo "$d"
29 fail=1
30 fi
31done
32
33set -x
34
35if [ "$fail" = 1 ]; then
36 exit 1
37fi
diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh
new file mode 100644
index 000000000..f538a4081
--- /dev/null
+++ b/.ci/scripts/linux/docker.sh
@@ -0,0 +1,14 @@
1#!/bin/bash -ex
2
3cd /yuzu
4
5ccache -s
6
7mkdir build || true && cd build
8cmake .. -G Ninja -DYUZU_USE_BUNDLED_UNICORN=ON -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON
9
10ninja
11
12ccache -s
13
14ctest -VV -C Release
diff --git a/.ci/scripts/linux/exec.sh b/.ci/scripts/linux/exec.sh
new file mode 100644
index 000000000..a5a6c34b9
--- /dev/null
+++ b/.ci/scripts/linux/exec.sh
@@ -0,0 +1,5 @@
1#!/bin/bash -ex
2
3mkdir -p "ccache" || true
4chmod a+x ./.ci/scripts/linux/docker.sh
5docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh
diff --git a/.ci/scripts/linux/upload.sh b/.ci/scripts/linux/upload.sh
new file mode 100644
index 000000000..0d131d1dd
--- /dev/null
+++ b/.ci/scripts/linux/upload.sh
@@ -0,0 +1,14 @@
1#!/bin/bash -ex
2
3. .ci/scripts/common/pre-upload.sh
4
5REV_NAME="yuzu-linux-${GITDATE}-${GITREV}"
6ARCHIVE_NAME="${REV_NAME}.tar.xz"
7COMPRESSION_FLAGS="-cJvf"
8
9mkdir "$REV_NAME"
10
11cp build/bin/yuzu-cmd "$REV_NAME"
12cp build/bin/yuzu "$REV_NAME"
13
14. .ci/scripts/common/post-upload.sh
diff --git a/.ci/scripts/merge/apply-patches-by-label.py b/.ci/scripts/merge/apply-patches-by-label.py
new file mode 100644
index 000000000..b346001a5
--- /dev/null
+++ b/.ci/scripts/merge/apply-patches-by-label.py
@@ -0,0 +1,28 @@
1# Download all pull requests as patches that match a specific label
2# Usage: python download-patches-by-label.py <Label to Match> <Root Path Folder to DL to>
3
4import requests, sys, json, urllib3.request, shutil, subprocess
5
6http = urllib3.PoolManager()
7dl_list = {}
8
9def check_individual(labels):
10 for label in labels:
11 if (label["name"] == sys.argv[1]):
12 return True
13 return False
14
15try:
16 url = 'https://api.github.com/repos/yuzu-emu/yuzu/pulls'
17 response = requests.get(url)
18 if (response.ok):
19 j = json.loads(response.content)
20 for pr in j:
21 if (check_individual(pr["labels"])):
22 pn = pr["number"]
23 print("Matched PR# %s" % pn)
24 print(subprocess.check_output(["git", "fetch", "https://github.com/yuzu-emu/yuzu.git", "pull/%s/head:pr-%s" % (pn, pn), "-f"]))
25 print(subprocess.check_output(["git", "merge", "--squash", "pr-%s" % pn]))
26 print(subprocess.check_output(["git", "commit", "-m\"Merge PR %s\"" % pn]))
27except:
28 sys.exit(-1)
diff --git a/.ci/scripts/merge/check-label-presence.py b/.ci/scripts/merge/check-label-presence.py
new file mode 100644
index 000000000..048466d7e
--- /dev/null
+++ b/.ci/scripts/merge/check-label-presence.py
@@ -0,0 +1,18 @@
1# Checks to see if the specified pull request # has the specified tag
2# Usage: python check-label-presence.py <Pull Request ID> <Name of Label>
3
4import requests, json, sys
5
6try:
7 url = 'https://api.github.com/repos/yuzu-emu/yuzu/issues/%s' % sys.argv[1]
8 response = requests.get(url)
9 if (response.ok):
10 j = json.loads(response.content)
11 for label in j["labels"]:
12 if label["name"] == sys.argv[2]:
13 print('##vso[task.setvariable variable=enabletesting;]true')
14 sys.exit()
15except:
16 sys.exit(-1)
17
18print('##vso[task.setvariable variable=enabletesting;]false')
diff --git a/.ci/scripts/merge/yuzubot-git-config.sh b/.ci/scripts/merge/yuzubot-git-config.sh
new file mode 100644
index 000000000..d9d595bbc
--- /dev/null
+++ b/.ci/scripts/merge/yuzubot-git-config.sh
@@ -0,0 +1,2 @@
1git config --global user.email "yuzu@yuzu-emu.org"
2git config --global user.name "yuzubot" \ No newline at end of file
diff --git a/.ci/scripts/windows/docker.sh b/.ci/scripts/windows/docker.sh
new file mode 100644
index 000000000..f7093363b
--- /dev/null
+++ b/.ci/scripts/windows/docker.sh
@@ -0,0 +1,50 @@
1#!/bin/bash -ex
2
3cd /yuzu
4
5ccache -s
6
7# Dirty hack to trick unicorn makefile into believing we are in a MINGW system
8mv /bin/uname /bin/uname1 && echo -e '#!/bin/sh\necho MINGW64' >> /bin/uname
9chmod +x /bin/uname
10
11# Dirty hack to trick unicorn makefile into believing we have cmd
12echo '' >> /bin/cmd
13chmod +x /bin/cmd
14
15mkdir build || true && cd build
16cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_UNICORN=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release
17ninja
18
19# Clean up the dirty hacks
20rm /bin/uname && mv /bin/uname1 /bin/uname
21rm /bin/cmd
22
23ccache -s
24
25echo "Tests skipped"
26#ctest -VV -C Release
27
28echo 'Prepare binaries...'
29cd ..
30mkdir package
31
32QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/'
33find build/ -name "yuzu*.exe" -exec cp {} 'package' \;
34
35# copy Qt plugins
36mkdir package/platforms
37cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/
38cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/
39cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
40rm -f package/mediaservice/*d.dll
41
42for i in package/*.exe; do
43 # we need to process pdb here, however, cv2pdb
44 # does not work here, so we just simply strip all the debug symbols
45 x86_64-w64-mingw32-strip "${i}"
46done
47
48pip3 install pefile
49python3 .ci/scripts/windows/scan_dll.py package/*.exe "package/"
50python3 .ci/scripts/windows/scan_dll.py package/imageformats/*.dll "package/"
diff --git a/.ci/scripts/windows/exec.sh b/.ci/scripts/windows/exec.sh
new file mode 100644
index 000000000..d6a994856
--- /dev/null
+++ b/.ci/scripts/windows/exec.sh
@@ -0,0 +1,5 @@
1#!/bin/bash -ex
2
3mkdir -p "ccache" || true
4chmod a+x ./.ci/scripts/windows/docker.sh
5docker run -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.ci/scripts/windows/docker.sh
diff --git a/.ci/scripts/windows/scan_dll.py b/.ci/scripts/windows/scan_dll.py
new file mode 100644
index 000000000..163183f2e
--- /dev/null
+++ b/.ci/scripts/windows/scan_dll.py
@@ -0,0 +1,106 @@
1import pefile
2import sys
3import re
4import os
5import queue
6import shutil
7
8# constant definitions
9KNOWN_SYS_DLLS = ['WINMM.DLL', 'MSVCRT.DLL', 'VERSION.DLL', 'MPR.DLL',
10 'DWMAPI.DLL', 'UXTHEME.DLL', 'DNSAPI.DLL', 'IPHLPAPI.DLL']
11# below is for Ubuntu 18.04 with specified PPA enabled, if you are using
12# other distro or different repositories, change the following accordingly
13DLL_PATH = [
14 '/usr/x86_64-w64-mingw32/bin/',
15 '/usr/x86_64-w64-mingw32/lib/',
16 '/usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/'
17]
18
19missing = []
20
21
22def parse_imports(file_name):
23 results = []
24 pe = pefile.PE(file_name, fast_load=True)
25 pe.parse_data_directories()
26
27 for entry in pe.DIRECTORY_ENTRY_IMPORT:
28 current = entry.dll.decode()
29 current_u = current.upper() # b/c Windows is often case insensitive
30 # here we filter out system dlls
31 # dll w/ names like *32.dll are likely to be system dlls
32 if current_u.upper() not in KNOWN_SYS_DLLS and not re.match(string=current_u, pattern=r'.*32\.DLL'):
33 results.append(current)
34
35 return results
36
37
38def parse_imports_recursive(file_name, path_list=[]):
39 q = queue.Queue() # create a FIFO queue
40 # file_name can be a string or a list for the convience
41 if isinstance(file_name, str):
42 q.put(file_name)
43 elif isinstance(file_name, list):
44 for i in file_name:
45 q.put(i)
46 full_list = []
47 while q.qsize():
48 current = q.get_nowait()
49 print('> %s' % current)
50 deps = parse_imports(current)
51 # if this dll does not have any import, ignore it
52 if not deps:
53 continue
54 for dep in deps:
55 # the dependency already included in the list, skip
56 if dep in full_list:
57 continue
58 # find the requested dll in the provided paths
59 full_path = find_dll(dep)
60 if not full_path:
61 missing.append(dep)
62 continue
63 full_list.append(dep)
64 q.put(full_path)
65 path_list.append(full_path)
66 return full_list
67
68
69def find_dll(name):
70 for path in DLL_PATH:
71 for root, _, files in os.walk(path):
72 for f in files:
73 if name.lower() == f.lower():
74 return os.path.join(root, f)
75
76
77def deploy(name, dst, dry_run=False):
78 dlls_path = []
79 parse_imports_recursive(name, dlls_path)
80 for dll_entry in dlls_path:
81 if not dry_run:
82 shutil.copy(dll_entry, dst)
83 else:
84 print('[Dry-Run] Copy %s to %s' % (dll_entry, dst))
85 print('Deploy completed.')
86 return dlls_path
87
88
89def main():
90 if len(sys.argv) < 3:
91 print('Usage: %s [files to examine ...] [target deploy directory]')
92 return 1
93 to_deploy = sys.argv[1:-1]
94 tgt_dir = sys.argv[-1]
95 if not os.path.isdir(tgt_dir):
96 print('%s is not a directory.' % tgt_dir)
97 return 1
98 print('Scanning dependencies...')
99 deploy(to_deploy, tgt_dir)
100 if missing:
101 print('Following DLLs are not found: %s' % ('\n'.join(missing)))
102 return 0
103
104
105if __name__ == '__main__':
106 main()
diff --git a/.ci/scripts/windows/upload.sh b/.ci/scripts/windows/upload.sh
new file mode 100644
index 000000000..de73d3541
--- /dev/null
+++ b/.ci/scripts/windows/upload.sh
@@ -0,0 +1,13 @@
1#!/bin/bash -ex
2
3. .ci/scripts/common/pre-upload.sh
4
5REV_NAME="yuzu-windows-mingw-${GITDATE}-${GITREV}"
6ARCHIVE_NAME="${REV_NAME}.tar.gz"
7COMPRESSION_FLAGS="-czvf"
8
9mkdir "$REV_NAME"
10# get around the permission issues
11cp -r package/* "$REV_NAME"
12
13. .ci/scripts/common/post-upload.sh
diff --git a/.ci/templates/build-single.yml b/.ci/templates/build-single.yml
new file mode 100644
index 000000000..77eeb96b5
--- /dev/null
+++ b/.ci/templates/build-single.yml
@@ -0,0 +1,21 @@
1parameters:
2 artifactSource: 'true'
3
4steps:
5- task: DockerInstaller@0
6 displayName: 'Prepare Environment'
7 inputs:
8 dockerVersion: '17.09.0-ce'
9- task: CacheBeta@0
10 displayName: 'Cache Build System'
11 inputs:
12 key: yuzu-v1-$(BuildName)-$(BuildSuffix)-$(CacheSuffix)
13 path: $(System.DefaultWorkingDirectory)/ccache
14 cacheHitVar: CACHE_RESTORED
15- script: chmod a+x ./.ci/scripts/$(ScriptFolder)/exec.sh && ./.ci/scripts/$(ScriptFolder)/exec.sh
16 displayName: 'Build'
17- script: chmod a+x ./.ci/scripts/$(ScriptFolder)/upload.sh && ./.ci/scripts/$(ScriptFolder)/upload.sh
18 displayName: 'Package Artifacts'
19- publish: artifacts
20 artifact: 'yuzu-$(BuildName)-$(BuildSuffix)'
21 displayName: 'Upload Artifacts'
diff --git a/.ci/templates/build-standard.yml b/.ci/templates/build-standard.yml
new file mode 100644
index 000000000..9975f5c49
--- /dev/null
+++ b/.ci/templates/build-standard.yml
@@ -0,0 +1,22 @@
1jobs:
2- job: build
3 displayName: 'standard'
4 pool:
5 vmImage: ubuntu-latest
6 strategy:
7 maxParallel: 10
8 matrix:
9 windows:
10 BuildSuffix: 'windows-mingw'
11 ScriptFolder: 'windows'
12 linux:
13 BuildSuffix: 'linux'
14 ScriptFolder: 'linux'
15 steps:
16 - template: ./sync-source.yml
17 parameters:
18 artifactSource: $(parameters.artifactSource)
19 needSubmodules: 'true'
20 - template: ./build-single.yml
21 parameters:
22 artifactSource: 'false' \ No newline at end of file
diff --git a/.ci/templates/build-testing.yml b/.ci/templates/build-testing.yml
new file mode 100644
index 000000000..101e52996
--- /dev/null
+++ b/.ci/templates/build-testing.yml
@@ -0,0 +1,30 @@
1jobs:
2- job: build_test
3 displayName: 'testing'
4 pool:
5 vmImage: ubuntu-latest
6 strategy:
7 maxParallel: 10
8 matrix:
9 windows:
10 BuildSuffix: 'windows-testing'
11 ScriptFolder: 'windows'
12 steps:
13 - task: PythonScript@0
14 condition: eq(variables['Build.Reason'], 'PullRequest')
15 displayName: 'Determine Testing Status'
16 inputs:
17 scriptSource: 'filePath'
18 scriptPath: '../scripts/merge/check-label-presence.py'
19 arguments: '$(System.PullRequest.PullRequestNumber) create-testing-build'
20 - ${{ if eq(variables.enabletesting, 'true') }}:
21 - template: ./sync-source.yml
22 parameters:
23 artifactSource: $(parameters.artifactSource)
24 needSubmodules: 'true'
25 - template: ./mergebot.yml
26 parameters:
27 matchLabel: 'testing-merge'
28 - template: ./build-single.yml
29 parameters:
30 artifactSource: 'false' \ No newline at end of file
diff --git a/.ci/templates/format-check.yml b/.ci/templates/format-check.yml
new file mode 100644
index 000000000..5061f1cb8
--- /dev/null
+++ b/.ci/templates/format-check.yml
@@ -0,0 +1,14 @@
1parameters:
2 artifactSource: 'true'
3
4steps:
5- template: ./sync-source.yml
6 parameters:
7 artifactSource: $(parameters.artifactSource)
8 needSubmodules: 'false'
9- task: DockerInstaller@0
10 displayName: 'Prepare Environment'
11 inputs:
12 dockerVersion: '17.09.0-ce'
13- script: chmod a+x ./.ci/scripts/format/exec.sh && ./.ci/scripts/format/exec.sh
14 displayName: 'Verify Formatting'
diff --git a/.ci/templates/merge.yml b/.ci/templates/merge.yml
new file mode 100644
index 000000000..efc82778a
--- /dev/null
+++ b/.ci/templates/merge.yml
@@ -0,0 +1,46 @@
1jobs:
2- job: merge
3 displayName: 'pull requests'
4 steps:
5 - checkout: self
6 submodules: recursive
7 - template: ./mergebot.yml
8 parameters:
9 matchLabel: '$(BuildName)-merge'
10 - task: ArchiveFiles@2
11 displayName: 'Package Source'
12 inputs:
13 rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
14 includeRootFolder: false
15 archiveType: '7z'
16 archiveFile: '$(Build.ArtifactStagingDirectory)/yuzu-$(BuildName)-source.7z'
17 - task: PublishPipelineArtifact@1
18 displayName: 'Upload Artifacts'
19 inputs:
20 targetPath: '$(Build.ArtifactStagingDirectory)/yuzu-$(BuildName)-source.7z'
21 artifact: 'yuzu-$(BuildName)-source'
22 replaceExistingArchive: true
23- job: upload_source
24 displayName: 'upload'
25 dependsOn: merge
26 steps:
27 - template: ./sync-source.yml
28 parameters:
29 artifactSource: 'true'
30 needSubmodules: 'true'
31 - script: chmod a+x $(System.DefaultWorkingDirectory)/.ci/scripts/merge/yuzubot-git-config.sh && $(System.DefaultWorkingDirectory)/.ci/scripts/merge/yuzubot-git-config.sh
32 displayName: 'Apply Git Configuration'
33 - script: git tag -a $(BuildName)-$(Build.BuildId) -m "yuzu $(BuildName) $(Build.BuildNumber) $(Build.DefinitionName)"
34 displayName: 'Tag Source'
35 - script: git remote add other $(GitRepoPushChangesURL)
36 displayName: 'Register Repository'
37 - script: git push --follow-tags --force other HEAD:$(GitPushBranch)
38 displayName: 'Update Code'
39 - script: git rev-list -n 1 $(BuildName)-$(Build.BuildId) > $(Build.ArtifactStagingDirectory)/tag-commit.sha
40 displayName: 'Calculate Release Point'
41 - task: PublishPipelineArtifact@1
42 displayName: 'Upload Release Point'
43 inputs:
44 targetPath: '$(Build.ArtifactStagingDirectory)/tag-commit.sha'
45 artifact: 'yuzu-$(BuildName)-release-point'
46 replaceExistingArchive: true \ No newline at end of file
diff --git a/.ci/templates/mergebot.yml b/.ci/templates/mergebot.yml
new file mode 100644
index 000000000..5211efcc6
--- /dev/null
+++ b/.ci/templates/mergebot.yml
@@ -0,0 +1,15 @@
1parameters:
2 matchLabel: 'dummy-merge'
3
4steps:
5 - script: mkdir $(System.DefaultWorkingDirectory)/patches && pip install requests urllib3
6 displayName: 'Prepare Environment'
7 - script: chmod a+x $(System.DefaultWorkingDirectory)/.ci/scripts/merge/yuzubot-git-config.sh && $(System.DefaultWorkingDirectory)/.ci/scripts/merge/yuzubot-git-config.sh
8 displayName: 'Apply Git Configuration'
9 - task: PythonScript@0
10 displayName: 'Discover, Download, and Apply Patches'
11 inputs:
12 scriptSource: 'filePath'
13 scriptPath: '.ci/scripts/merge/apply-patches-by-label.py'
14 arguments: '${{ parameters.matchLabel }} patches'
15 workingDirectory: '$(System.DefaultWorkingDirectory)'
diff --git a/.ci/templates/release.yml b/.ci/templates/release.yml
new file mode 100644
index 000000000..60bebd2aa
--- /dev/null
+++ b/.ci/templates/release.yml
@@ -0,0 +1,29 @@
1steps:
2 - task: DownloadPipelineArtifact@2
3 displayName: 'Download Windows Release'
4 inputs:
5 artifactName: 'yuzu-$(BuildName)-windows-mingw'
6 buildType: 'current'
7 targetPath: '$(Build.ArtifactStagingDirectory)'
8 - task: DownloadPipelineArtifact@2
9 displayName: 'Download Linux Release'
10 inputs:
11 artifactName: 'yuzu-$(BuildName)-linux'
12 buildType: 'current'
13 targetPath: '$(Build.ArtifactStagingDirectory)'
14 - task: DownloadPipelineArtifact@2
15 displayName: 'Download Release Point'
16 inputs:
17 artifactName: 'yuzu-$(BuildName)-release-point'
18 buildType: 'current'
19 targetPath: '$(Build.ArtifactStagingDirectory)'
20 - script: echo '##vso[task.setvariable variable=tagcommit]' && cat $(Build.ArtifactStagingDirectory)/tag-commit.sha
21 displayName: 'Calculate Release Point'
22 - task: GitHubRelease@0
23 inputs:
24 gitHubConnection: $(GitHubReleaseConnectionName)
25 repositoryName: '$(GitHubReleaseRepoName)'
26 action: 'create'
27 target: $(variables.tagcommit)
28 title: 'yuzu $(BuildName) #$(Build.BuildId)'
29 assets: '$(Build.ArtifactStagingDirectory)/*'
diff --git a/.ci/templates/retrieve-artifact-source.yml b/.ci/templates/retrieve-artifact-source.yml
new file mode 100644
index 000000000..47d217e7b
--- /dev/null
+++ b/.ci/templates/retrieve-artifact-source.yml
@@ -0,0 +1,16 @@
1steps:
2- checkout: none
3- task: DownloadPipelineArtifact@2
4 displayName: 'Download Source'
5 inputs:
6 artifactName: 'yuzu-$(BuildName)-source'
7 buildType: 'current'
8 targetPath: '$(Build.ArtifactStagingDirectory)'
9- script: rm -rf $(System.DefaultWorkingDirectory) && mkdir $(System.DefaultWorkingDirectory)
10 displayName: 'Clean Working Directory'
11- task: ExtractFiles@1
12 displayName: 'Prepare Source'
13 inputs:
14 archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/*.7z'
15 destinationFolder: '$(System.DefaultWorkingDirectory)'
16 cleanDestinationFolder: false \ No newline at end of file
diff --git a/.ci/templates/retrieve-master-source.yml b/.ci/templates/retrieve-master-source.yml
new file mode 100644
index 000000000..a08a3f926
--- /dev/null
+++ b/.ci/templates/retrieve-master-source.yml
@@ -0,0 +1,11 @@
1parameters:
2 needSubmodules: 'true'
3
4steps:
5- checkout: self
6 displayName: 'Checkout Recursive'
7 submodules: recursive
8# condition: eq(parameters.needSubmodules, 'true')
9#- checkout: self
10# displayName: 'Checkout Fast'
11# condition: ne(parameters.needSubmodules, 'true')
diff --git a/.ci/templates/sync-source.yml b/.ci/templates/sync-source.yml
new file mode 100644
index 000000000..409e1cd83
--- /dev/null
+++ b/.ci/templates/sync-source.yml
@@ -0,0 +1,7 @@
1steps:
2- ${{ if eq(parameters.artifactSource, 'true') }}:
3 - template: ./retrieve-artifact-source.yml
4- ${{ if ne(parameters.artifactSource, 'true') }}:
5 - template: ./retrieve-master-source.yml
6 parameters:
7 needSubmodules: $(parameters.needSubmodules) \ No newline at end of file
diff --git a/.ci/yuzu-mainline.yml b/.ci/yuzu-mainline.yml
index aa912913d..164bcb165 100644
--- a/.ci/yuzu-mainline.yml
+++ b/.ci/yuzu-mainline.yml
@@ -1,19 +1,23 @@
1# Starter pipeline
2# Start with a minimal pipeline that you can customize to build and deploy your code.
3# Add steps that build, run tests, deploy, and more:
4# https://aka.ms/yaml
5
6trigger: 1trigger:
7- master 2- master
8 3
9pool: 4stages:
10 vmImage: 'ubuntu-latest' 5- stage: merge
11 6 displayName: 'merge'
12steps: 7 jobs:
13- script: echo Hello, world! 8 - template: ./templates/merge.yml
14 displayName: 'Run a one-line script' 9- stage: format
15 10 dependsOn: merge
16- script: | 11 displayName: 'format'
17 echo Add other tasks to build, test, and deploy your project. 12 jobs:
18 echo See https://aka.ms/yaml 13 - job: format
19 displayName: 'Run a multi-line script' 14 displayName: 'clang'
15 pool:
16 vmImage: ubuntu-latest
17 steps:
18 - template: ./templates/format-check.yml
19- stage: build
20 displayName: 'build'
21 dependsOn: format
22 jobs:
23 - template: ./templates/build-standard.yml
diff --git a/.ci/yuzu-verify.yml b/.ci/yuzu-verify.yml
new file mode 100644
index 000000000..d01c1feed
--- /dev/null
+++ b/.ci/yuzu-verify.yml
@@ -0,0 +1,18 @@
1stages:
2- stage: format
3 displayName: 'format'
4 jobs:
5 - job: format
6 displayName: 'clang'
7 pool:
8 vmImage: ubuntu-latest
9 steps:
10 - template: ./templates/format-check.yml
11 parameters:
12 artifactSource: 'false'
13- stage: build
14 displayName: 'build'
15 dependsOn: format
16 jobs:
17 - template: ./templates/build-standard.yml
18 - template: ./templates/build-testing.yml \ No newline at end of file
diff --git a/.ci/yuzu.yml b/.ci/yuzu.yml
deleted file mode 100644
index aa912913d..000000000
--- a/.ci/yuzu.yml
+++ /dev/null
@@ -1,19 +0,0 @@
1# Starter pipeline
2# Start with a minimal pipeline that you can customize to build and deploy your code.
3# Add steps that build, run tests, deploy, and more:
4# https://aka.ms/yaml
5
6trigger:
7- master
8
9pool:
10 vmImage: 'ubuntu-latest'
11
12steps:
13- script: echo Hello, world!
14 displayName: 'Run a one-line script'
15
16- script: |
17 echo Add other tasks to build, test, and deploy your project.
18 echo See https://aka.ms/yaml
19 displayName: 'Run a multi-line script'