diff --git a/.travis.yml b/.travis.yml index 718d3352..6ee8c139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ matrix: addons: apt: packages: + - python3-pip - socat env: global: @@ -46,7 +47,6 @@ before_install: - popd install: - pushd $TEST_DIR - - command -v pip3 || sudo apt install python3-pip - make install - if [[ $DEPLOY_ARTIFACTS = 1 ]]; then make artifacts-install; fi - popd @@ -73,12 +73,3 @@ deploy: branch: master tags: true condition: $DEPLOY_ARTIFACTS = 1 -notifications: - slack: - rooms: - - secure: iByImumEaLfRhxD5wxER3qovftyqSeaQdtdp5y80MSPZMa9AL6NkpyhZPl8WaQxUYvvzWo4/dbal+Qb17ew4hRDsprKbvXh3SP/0SLSe0QAK3ShB+iLBAFX04ZoTRMxdgKvU4LZPbJGSizBWD6lHHz3JCILSpjXtfgL1g74vejVJY2VqMW4Vn4YXfPx39z5v23O9GNzx9S2zGb0dN77ilSRJr/wVzsYqZD8jcgaD63pZ/TCSgxJcVQAvztVaWKkbh19qrP6M4WV1rxIZN8ksnBe1gUJ/VIylMWnf3CRwLaJw4+Z+aqm1GUbD7tsi9BA2D7gmlJC/yv4vzejMCtOpU8z4ymBpvJ6A7uBdv5CMGcOWx35FEpB5LwSGKXk0/5/Ar3HjHzQtB/K7a7PuzvHUROdNUi+9Q6kUAZlEfzEsbEd/sxMy09m6kBKUpluDueJCBcS0qGYlZ+7roQwEs5CEPBqOUhZne3kNH+HXsyHgs4r83FlPEqqnhdswqQYgWYOdrIQVUXX3L8CnCpuFojevwdN+nb/ahwsl0XQl5lgaFcIsU4tZpYHxXExzpWJfN7Y3MvRbFOfNab8LSodAHjvvzXJrmh8lrlv3TYtW5mWDyPg56CTysMOuVRyc74bvvhidff3tUTw62VqH13XESVcdsOEv0g8Jz4ZnzInxJTimX9o= - template: - - "Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) of %{repository}@%{branch} by %{author} %{result} in %{duration}" - - "@onibrow Your meatballs are ready!" - on_success: change - on_failure: always diff --git a/DevOps/pipeline/deploy-artifacts.sh b/DevOps/pipeline/deploy-artifacts.sh index b88c047e..07e43f5b 100755 --- a/DevOps/pipeline/deploy-artifacts.sh +++ b/DevOps/pipeline/deploy-artifacts.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Usage: ./DevOps/pipeline/artifacts-pipeline.sh "" "" "" +# Usage: ./deploy-artifacts.sh "" "" "" set -e pushd DevOps diff --git a/DevOps/pipeline/pipeline.py b/DevOps/pipeline/pipeline.py index ff13e07f..785c577e 100755 --- a/DevOps/pipeline/pipeline.py +++ b/DevOps/pipeline/pipeline.py @@ -27,14 +27,18 @@ SOFTWARE_PAGE = 'software/index.html' PR_COMMIT_TEMPLATE = 'Software Release "{tag}"' -artifactS = { +PR_BODY_TEMPLATE = """ +| Artifact Name | Size (KiB) | Content Type | +|-------------- | ---------- | ------------ | +""".strip() +ARTIFACTS = { 'dawn': { re.compile(r'^dawn-win32'): 'dawn-win32-url', re.compile(r'^dawn-darwin'): 'dawn-macos-url', re.compile(r'^dawn-linux'): 'dawn-linux-url', }, 'runtime': { - re.compile(r'^frankfurter'): 'runtime-url', + re.compile(r'^frankfurter-update'): 'runtime-url', } } TAG_PATTERN = re.compile(r'^(?Pdawn|runtime)/(?P[\d\.]+)') @@ -82,9 +86,9 @@ def get_repo(self, owner, repo): return Github(access_token).get_repo(f'{owner}/{repo}') -def get_commit_from_tag(repo, tag): +def get_commit_from_tag(repo, target_tag): for tag in repo.get_tags(): - if tag.name == tag: + if tag.name == target_tag: return tag.commit @@ -99,7 +103,7 @@ def artifact_label(name): def create_release(repo, tag, artifacts_dir, draft=False, prerelease=False): commit = get_commit_from_tag(repo, tag) if not commit: - logging.warn(f'Unable to find tag "{tag}". Skipping release.') + logging.warning(f'Unable to find tag "{tag}". Skipping release.') return None, [] release = repo.create_git_release(tag, tag, commit.commit.message, draft=draft, prerelease=prerelease) @@ -108,9 +112,10 @@ def create_release(repo, tag, artifacts_dir, draft=False, prerelease=False): artifact = os.path.join(artifacts_dir, filename) if os.path.isfile(artifact): artifact = release.upload_asset(artifact, label=artifact_label(filename)) - logging.info(f'Uploading artifact "{artifact}" ...') + artifacts.append(artifact) + logging.info(f'Uploading artifact "{artifact.name}" ...') else: - logging.warn(f'Cannot upload directory "{artifact}". Skipping.') + logging.warning(f'Cannot upload directory "{artifact}". Skipping.') logging.info(f'Created release for tag "{tag}".') return release, artifacts @@ -124,16 +129,21 @@ def make_pull_request(repo, tag, artifacts, src_branch='master'): page = repo.get_file_contents(SOFTWARE_PAGE, ref=branch_to_ref(src_branch)) contents = base64.b64decode(page.content.encode('utf-8')).decode('utf-8') - tag_match = TAG_PATTERN.match(tag) + tag_match, pr_body = TAG_PATTERN.match(tag), PR_BODY_TEMPLATE project, version = tag_match.group('project'), tag_match.group('version') - for label_pattern, page_key in artifactS.get(project, {}).items(): + for label_pattern, page_key in ARTIFACTS.get(project, {}).items(): for artifact in artifacts: label = artifact.label or artifact_label(artifact.name) if label_pattern.match(label): contents = replace_page_key(contents, page_key, artifact.browser_download_url) + pr_body += ' | '.join([ + f'[`{artifact.name}`]({artifact.browser_download_url})', + str(round(artifact.size/1024, 1)), + f'`{artifact.content_type}`', + ]).strip() + '\n' break else: - logging.warn('Unable to find artifact for "{page_key}". Skipping.') + logging.warning(f'Unable to find artifact for "{page_key}". Skipping.') today = datetime.date.today().strftime('%B %d, %Y') contents = replace_page_key(contents, f'{project}-latest-ver', version) @@ -142,7 +152,7 @@ def make_pull_request(repo, tag, artifacts, src_branch='master'): ref = repo.create_git_ref(branch_to_ref(tag), sha=branch.commit.sha) message = PR_COMMIT_TEMPLATE.format(tag=tag) repo.update_file(SOFTWARE_PAGE, message, contents.encode('utf-8'), page.sha, branch=tag) - pr = repo.create_pull(title=message, base=src_branch, head=tag) + pr = repo.create_pull(title=message, body=pr_body, base=src_branch, head=tag) logging.info(f'Created pull request #{pr.id} for "{repo.owner}/{repo.name}".') return pr diff --git a/dawn/renderer/constants/Constants.js b/dawn/renderer/constants/Constants.js index 1603ff06..37fe67c3 100755 --- a/dawn/renderer/constants/Constants.js +++ b/dawn/renderer/constants/Constants.js @@ -1,7 +1,6 @@ import keyMirror from 'keymirror'; -// Read as YEAR.PUBLIC.INTERNAL -export const VERSION = '2019.1.0'; +export const VERSION = '2.0.0'; export const PeripheralTypes = keyMirror({ MOTOR_SCALAR: null, SENSOR_BOOLEAN: null,