blob: 7968ad4fba038658663537cff58e3a26d6468417 [file] [log] [blame]
- 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
msg: "extension_id, credentials.clientId and credentials.refreshToken must be set"
- name: Build extension
name: build-extension
make_target: release_chromium_canary
- name: Get name of the compiled ZIP file
cmd: "ls -Art | tail -n 1"
chdir: "{{ zuul.project.src_dir }}/out"
register: zip_file
- name: Check the ZIP file name is non-empty
when: zip_file.stdout == ""
msg: "zip_file.stdout is empty"
- name: Print ZIP file name
when: not (zip_file.stdout == "")
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)
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)
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)"
msg: "{{ uploadlog.stdout }}"