Update nightly build job
- (Reland) Update CWS credentials: the OAuth OOB flow will be deprecated
on October 3, 2022, so this CL adds regenerated credentials which use
another flow to avoid the deprecation.
- (Reland) It also adds a suffix to the name of the secret to avoid name
collision, since Zuul requires credential names to be unique
throughout each tenant.
- The chrome-webstore-upload-cli package is bumped from 2.0.1 to 2.1.0.
- The job now uses the cws-upload and fetch-cws-upload-log roles in the
common zuul/jobs repo (which have moved from this project to there so
they can be used by other projects as well).
Change-Id: I93101f453999262a43f1a5d0f39e41548b0feb9c
diff --git a/roles/cws-publish/tasks/main.yaml b/roles/cws-publish/tasks/main.yaml
index 7968ad4..b93f1cb 100644
--- a/roles/cws-publish/tasks/main.yaml
+++ b/roles/cws-publish/tasks/main.yaml
@@ -1,10 +1,3 @@
-- name: Check extension_id, credentials.clientId, credentials.refreshToken are set
- when: >
- extension_id is not defined or credentials.clientId is not defined or
- credentials.refreshToken is not defined
- fail:
- msg: "extension_id, credentials.clientId and credentials.refreshToken must be set"
-
- name: Build extension
include_role:
name: build-extension
@@ -27,31 +20,15 @@
debug:
msg: "zip_file.stdout is \"{{ zip_file.stdout }}\""
-- name: Upload and publish the ZIP file to the Chrome Web Store
- when: not (dry_run|bool)
- ansible.builtin.shell:
- cmd: |
- set -o pipefail
- chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }} \
- --trusted-testers --source {{ zip_file.stdout|quote }} \
- --client-id {{ credentials.clientId|quote }} \
- --refresh-token {{ credentials.refreshToken|quote }} \
- 2>&1 | tee cws-log.txt
- chdir: "{{ zuul.project.src_dir }}/out"
- executable: /bin/bash
- no_log: True
- register: uploadcmd
- failed_when: false
-
-- name: Read upload log
- when: not (dry_run|bool)
- ansible.builtin.shell:
- cmd: cat cws-log.txt
- chdir: "{{ zuul.project.src_dir }}/out"
- executable: /bin/bash
- register: uploadlog
-
-- name: Check whether the upload was successful
- when: "not (dry_run|bool) and not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadlog.stdout) or ('PKG_INVALID_VERSION_NUMBER') in uploadlog.stdout)"
- fail:
- msg: "{{ uploadlog.stdout }}"
+- when: not (dryRun|bool)
+ include_role:
+ name: cws-upload
+ vars:
+ extensionId: "{{ canaryTwptExtensionId }}"
+ clientId: "{{ credentials.clientId }}"
+ clientSecret: "{{ credentials.clientSecret }}"
+ refreshToken: "{{ credentials.refreshToken }}"
+ workingDirectory: "{{ zuul.project.src_dir }}/out"
+ zipFile: "{{ zip_file.stdout|quote }}"
+ autopublish: true
+ trustedTesters: true