Canary build: save CWS upload/publish log

Also, fix a bug in the upload/publish command and fail when it exits
with a non-zero return code and doesn't fail with a ITEM_NOT_UPDATABLE
error.

Bug: twpowertools:20
Change-Id: I309e72b4a938be55782d0a7a18c1905ceb6cf304
diff --git a/roles/cws-publish/tasks/main.yaml b/roles/cws-publish/tasks/main.yaml
index 5ab7d8d..f8d4435 100644
--- a/roles/cws-publish/tasks/main.yaml
+++ b/roles/cws-publish/tasks/main.yaml
@@ -31,7 +31,11 @@
   when: not (dry_run|bool)
   ansible.builtin.command:
     cmd: >
-      "chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }}
+      chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }}
       --source {{ zuul.project.src_dir|quote }}/out/{{ zip_file.stdout|quote }}
-      --client-id {{ credentials.clientId|quote }} --refresh-token {{ credentials.refreshToken|quote }}"
+      --client-id {{ credentials.clientId|quote }} --refresh-token {{ credentials.refreshToken|quote }}
+      2>cws-log.txt
   no_log: True
+  register: uploadcmd
+  failed_when:
+    - not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadcmd.stderr))