-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create mv3 beta build * Prepare release 2022.10.24 * CI: Publish Chrome MV3 beta * Bump action versions * Prepare release * Push changes to a new branch Prevents error when we might try to push to a protected branch (develop)
- Loading branch information
1 parent
87b6c58
commit a206dc1
Showing
10 changed files
with
2,100 additions
and
135 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Beta Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
chrome_mv3_beta: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Restore npm artifact from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: | | ||
npm run install-ci | ||
- name: Fetch config and update version | ||
run: | | ||
npm run bundle-config | ||
node scripts/bumpVersion.js $(date "+%Y.%m.%d") | ||
echo "VERSION=$(jq -r .version ./browser/chrome-mv3/manifest.json)" >> $GITHUB_ENV | ||
- name: Commit config and version updates | ||
uses: stefanzweifel/git-auto-commit-action@f6f7a9c351bb990cab0093f66c0d443d3a108a6f | ||
with: | ||
commit_message: "Prepare release ${{ env.VERSION }}" | ||
tagging_message: ${{ env.VERSION }} | ||
create_branch: true | ||
branch: "release/beta/${{ env.VERSION }}" | ||
|
||
- name: Build Chrome MV3 Beta | ||
run: | | ||
npm run beta-chrome-mv3 | ||
- name: Publish to Chrome Store | ||
env: | ||
CWS_CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }} | ||
CWS_CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }} | ||
CWS_REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }} | ||
run: | | ||
bash ./scripts/chrome-store-publish.sh ${{ secrets.CWS_BETA_EXTENSION_ID }} ./build/chrome-mv3/release/chrome-release-*.zip |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Publish a Chrome extension zip to the chrome store for a given extension ID. | ||
# Args: <Extension Item ID> <Path to zip> | ||
ITEM_ID=$1 | ||
FILE_NAME=$2 | ||
|
||
# Get an access token | ||
ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" \ | ||
-d "client_id=$CWS_CLIENT_ID&client_secret=$CWS_CLIENT_SECRET&refresh_token=$CWS_REFRESH_TOKEN&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token) | ||
|
||
# Upload release zip | ||
curl \ | ||
-H "Authorization: Bearer $ACCESS_TOKEN" \ | ||
-H "x-goog-api-version: 2" \ | ||
-X PUT \ | ||
-T $FILE_NAME \ | ||
https://www.googleapis.com/upload/chromewebstore/v1.1/items/$ITEM_ID | ||
|
||
# Publish the item | ||
curl \ | ||
-H "Authorization: Bearer $ACCESS_TOKEN" \ | ||
-H "x-goog-api-version: 2" \ | ||
-d "{\"target\": \"default\"}" \ | ||
https://www.googleapis.com/chromewebstore/v1.1/items/$ITEM_ID/publish |
Oops, something went wrong.