Release v1.2.1 #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push new version to the update manifest | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
push-update-manifest-firefox: | |
name: Push new version of the extension to the update manifest for the Firefox | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Extract xpi asset link from the event payload | |
id: jq-stuff | |
uses: sergeysova/jq-action@v2 | |
with: | |
cmd: 'jq ".release.assets | map(select(.name? | test(\".*xpi\")))[0].browser_download_url" -r <<< "$EVENT_PAYLOAD_JSON"' | |
env: | |
EVENT_PAYLOAD_JSON: ${{ toJson(github.event) }} | |
- name: Download the extension file | |
uses: wei/wget@v1 | |
with: | |
args: -O extension.xpi "$ASSET_URL" | |
env: | |
ASSET_URL: ${{ steps.jq-stuff.outputs.value }} | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Generate new update manifest | |
run: > | |
node script/update.js --updateLink "$ASSET_URL" --extensionFilePath "extension.xpi" --existingUpdateManifest "pages/updates.json" --newUpdateManifestPath "pages/updates.json" | |
env: | |
ASSET_URL: ${{ steps.jq-stuff.outputs.value }} | |
- id: extract-version | |
name: Extract the version from the tag name | |
run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_OUTPUT | |
env: | |
TAG_NAME: ${{ github.event.release.tag_name }} | |
- name: Create a pull request with the changes to the update manifest | |
uses: gr2m/create-or-update-pull-request-action@v1 | |
with: | |
title: Add update entry for v${{ steps.extract-version.outputs.VERSION }} | |
body: | | |
Add new update entry to the extension update manifest for release ${{ steps.extract-version.outputs.VERSION }} | |
Auto-generated by GitHub Action | |
author: pull-request-github-action[bot] <pull-request-github-action[bot]@users.noreply.github.com> | |
commit-message: Add update entry for ${{ steps.extract-version.outputs.VERSION }} | |
path: pages/ | |
labels: update manifest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
push-chrome-web-store: | |
name: Push new version of the extension to the Chrome Web Store | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Extract a zip asset link from the event payload | |
id: jq-stuff | |
uses: sergeysova/jq-action@v2 | |
with: | |
cmd: 'jq ".release.assets | map(select(.name? | test(\".*zip\")))[0].browser_download_url" -r <<< "$EVENT_PAYLOAD_JSON"' | |
env: | |
EVENT_PAYLOAD_JSON: ${{ toJson(github.event) }} | |
- name: Download the extension file | |
uses: wei/wget@v1 | |
with: | |
args: -O extension.zip "$ASSET_URL" | |
env: | |
ASSET_URL: ${{ steps.jq-stuff.outputs.value }} | |
- name: Upload & release | |
uses: mnao305/[email protected] | |
with: | |
file-path: extension.zip | |
extension-id: ${{ secrets.CWS_EXTENSION_ID }} | |
client-id: ${{ secrets.CWS_CLIENT_ID }} | |
client-secret: ${{ secrets.CWS_CLIENT_SECRET }} | |
refresh-token: ${{ secrets.CWS_REFRESH_TOKEN }} | |
publish: false |