Adrià Vilanova MartÃnez | a7d7f8d | 2022-01-16 12:33:57 +0100 | [diff] [blame^] | 1 | - 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) |
| 32 | ansible.builtin.command: |
| 33 | cmd: > |
| 34 | "chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }} |
| 35 | --source {{ zuul.project.src_dir|quote }}/out/{{ zip_file.stdout|quote }} |
| 36 | --client-id {{ credentials.clientId|quote }} --refresh-token {{ credentials.refreshToken|quote }}" |
| 37 | no_log: True |