Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/publish actions: Add Chrome web store automation #2162

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@ jobs:
}
return version;

# - name: Chrome — Build
# run: npm run build
# - name: Chrome — Upload and Publish
# run: npx chrome-webstore-upload --source=web-ext-artifacts/new_xkit-${{ steps.get-version.outputs.result }}.zip
# env:
# EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
# CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
# CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
# REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
- name: Chrome — Build
run: npm run build

# uploads to Chrome Web Store servers, but does not publish;
# see https://github.com/fregante/chrome-webstore-upload-cli#usage
- name: Chrome — Upload
run: npm run chrome-upload -- --source=web-ext-artifacts/new_xkit-${{ steps.get-version.outputs.result }}.zip
continue-on-error: true
env:
EXTENSION_ID: ${{ secrets.CWS_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }}

- name: Create Github release draft
uses: softprops/action-gh-release@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ jobs:
### NOTE: This workflow may time out here while waiting for Mozilla review.
### If this occurs, run the "Generate Release (after signing)" action once it is complete.

# - name: Chrome — Build
# run: npm run build
# - name: Chrome — Upload and Publish
# run: npx chrome-webstore-upload --source=web-ext-artifacts/new_xkit-${{ steps.get-version.outputs.result }}.zip
# env:
# EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
# CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
# CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
# REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
- name: Chrome — Build
run: npm run build

# uploads to Chrome Web Store servers, but does not publish;
# see https://github.com/fregante/chrome-webstore-upload-cli#usage
- name: Chrome — Upload
run: npm run chrome-upload -- --source=web-ext-artifacts/new_xkit-${{ steps.get-version.outputs.result }}.zip
continue-on-error: true
env:
EXTENSION_ID: ${{ secrets.CWS_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }}

- name: Create Github release draft
uses: softprops/action-gh-release@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update Release Metadata
name: Publish Release

on:
workflow_dispatch:
Expand All @@ -9,8 +9,8 @@ on:
required: false

jobs:
create-update-pr:
name: Create update PR
publish-releases:
name: Publish Releases
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -22,10 +22,21 @@ jobs:
node-version: lts/*
cache: npm

# publishes the last uploaded version on Chrome Web Store servers;
# see https://github.com/fregante/chrome-webstore-upload-cli#usage
- name: Chrome — Publish Release
run: npm run chrome-publish
continue-on-error: true
env:
EXTENSION_ID: ${{ secrets.CWS_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }}

- name: Update release metadata
run: node dev/update_release_metadata.mjs ${{ inputs.newVersion || '' }}

- name: Create pull request
- name: Create release pull request
uses: peter-evans/create-pull-request@v7
with:
title: Update release metadata
Expand Down
135 changes: 135 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"test": "eslint .",
"lint": "web-ext lint",
"build": "web-ext build",
"sign": "web-ext sign"
"sign": "web-ext sign",
"chrome-upload": "chrome-webstore-upload upload",
"chrome-publish": "chrome-webstore-upload publish"
},
"devDependencies": {
"chrome-webstore-upload-cli": "^3.3.1",
"dotenv": "^16.4.5",
"eslint": "^7.32.0",
"jsonwebtoken": "^9.0.2",
Expand Down