Skip to content
Merged
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
42 changes: 33 additions & 9 deletions .github/workflows/publish-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,39 @@ jobs:
working-directory: packages/devtools-extension
run: cd dist && zip -r ../extension-chrome.zip .

- name: Upload to Chrome Web Store
uses: mnao305/chrome-extension-upload@4008e29e13c144d0f6725462cbd49b7c291b4928 # v5.0.0
with:
file-path: packages/devtools-extension/extension-chrome.zip
extension-id: ${{ secrets.CHROME_EXTENSION_ID }}
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish: true
- name: Upload and publish to Chrome Web Store
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 }}
run: |
# Get access token
TOKEN=$(curl -s -X POST https://oauth2.googleapis.com/token \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET" \
-d "refresh_token=$REFRESH_TOKEN" \
-d "grant_type=refresh_token" | jq -r '.access_token')

# Upload
UPLOAD=$(curl -s \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-api-version: 2" \
-X PUT \
-T packages/devtools-extension/extension-chrome.zip \
"https://www.googleapis.com/upload/chromewebstore/v1.1/items/$EXTENSION_ID")
echo "Upload response: $UPLOAD"
echo "$UPLOAD" | jq -e '.uploadState == "SUCCESS"' || exit 1

# Publish to default (public)
PUBLISH=$(curl -s \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-api-version: 2" \
-H "Content-Length: 0" \
-X POST \
"https://www.googleapis.com/chromewebstore/v1.1/items/$EXTENSION_ID/publish")
echo "Publish response: $PUBLISH"
echo "$PUBLISH" | jq -e '.status[0] == "OK"' || { echo "::error::Publish failed — see response above"; exit 1; }

publish-firefox:
runs-on: ubuntu-latest
Expand Down
41 changes: 32 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,38 @@ jobs:

- name: Publish Chrome extension to testers
if: inputs.extension
uses: mnao305/chrome-extension-upload@4008e29e13c144d0f6725462cbd49b7c291b4928 # v5.0.0
with:
file-path: packages/devtools-extension/extension-chrome.zip
extension-id: ${{ secrets.CHROME_EXTENSION_ID }}
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish: true
publish-target: trustedTesters
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 }}
run: |
# Get access token
TOKEN=$(curl -s -X POST https://oauth2.googleapis.com/token \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET" \
-d "refresh_token=$REFRESH_TOKEN" \
-d "grant_type=refresh_token" | jq -r '.access_token')

# Upload
UPLOAD=$(curl -s \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-api-version: 2" \
-X PUT \
-T packages/devtools-extension/extension-chrome.zip \
"https://www.googleapis.com/upload/chromewebstore/v1.1/items/$EXTENSION_ID")
echo "Upload response: $UPLOAD"
echo "$UPLOAD" | jq -e '.uploadState == "SUCCESS"' || exit 1

# Publish to trusted testers
PUBLISH=$(curl -s \
-H "Authorization: Bearer $TOKEN" \
-H "x-goog-api-version: 2" \
-H "Content-Length: 0" \
-X POST \
"https://www.googleapis.com/chromewebstore/v1.1/items/$EXTENSION_ID/publish?publishTarget=trustedTesters")
echo "Publish response: $PUBLISH"
echo "$PUBLISH" | jq -e '.status[0] == "OK"' || { echo "::error::Publish failed — see response above"; exit 1; }

- name: Build Firefox extension
if: inputs.extension
Expand Down
Loading