blob: a22f5317a1f7f1df3887381a8e67604ac2e563dd [file] [log] [blame]
Adrià Vilanova Martíneza7d7f8d2022-01-16 12:33:57 +01001- name: Check extension_id, credentials.clientId, credentials.refreshToken are set
2 when: >
3 extension_id is not defined or credentials.clientId is not defined or
4 credentials.refreshToken is not defined
5 fail:
6 msg: "extension_id, credentials.clientId and credentials.refreshToken must be set"
7
8- name: Build extension
9 include_role:
10 name: build-extension
11 vars:
12 make_target: release_chromium_canary
13
14- name: Get name of the compiled ZIP file
15 ansible.builtin.shell:
16 cmd: "ls -Art | tail -n 1"
17 chdir: "{{ zuul.project.src_dir }}/out"
18 register: zip_file
19
20- name: Check the ZIP file name is non-empty
21 when: zip_file.stdout == ""
22 fail:
23 msg: "zip_file.stdout is empty"
24
25- name: Print ZIP file name
26 when: not (zip_file.stdout == "")
27 debug:
28 msg: "zip_file.stdout is \"{{ zip_file.stdout }}\""
29
30- name: Upload and publish the ZIP file to the Chrome Web Store
31 when: not (dry_run|bool)
Adrià Vilanova Martínezc2c3c362022-01-17 00:45:05 +010032 ansible.builtin.shell:
Adrià Vilanova Martínez2a8c0742022-01-17 16:54:17 +010033 cmd: |
Adrià Vilanova Martínez60db9782022-01-17 20:38:29 +010034 set -o pipefail
Adrià Vilanova Martínez2a8c0742022-01-17 16:54:17 +010035 chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }} \
36 --source {{ zip_file.stdout|quote }} \
37 --client-id {{ credentials.clientId|quote }} \
38 --refresh-token {{ credentials.refreshToken|quote }} \
Adrià Vilanova Martínez9f884e82022-01-17 20:11:29 +010039 2>&1 | tee cws-log.txt
Adrià Vilanova Martínezde736be2022-01-17 01:23:03 +010040 chdir: "{{ zuul.project.src_dir }}/out"
Adrià Vilanova Martínez60db9782022-01-17 20:38:29 +010041 executable: /bin/bash
Adrià Vilanova Martíneza7d7f8d2022-01-16 12:33:57 +010042 no_log: True
Adrià Vilanova Martíneza8341d02022-01-17 00:18:30 +010043 register: uploadcmd
44 failed_when:
Adrià Vilanova Martínezd5b87ec2022-01-28 00:42:27 +010045 - "not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadcmd.stdout) or ('PKG_INVALID_VERSION_NUMBER') in uploadcmd.stdout)"