-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolved #58: [MV3] CI deployment / publish workflow for chrome and edge
* added ci deployment for auto publishing extensions * changed to use non-bpp workflows until bpp has upload option in edge-addon-api * changed to use non-bpp workflows until bpp has upload option in edge-addon-api * added paths on build-test so not to run test everytime
- Loading branch information
Showing
3 changed files
with
111 additions
and
10 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
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,68 @@ | ||
name: Publish Extensions (unused) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
description: 'dry run mode, will upload to the store but not publish and turn on verbose logging' | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
build: | ||
if: false # due to BPP edge-addon-api has no upload only option, hold this action for now | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
browser: [chrome, edge] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Build And Package Extensions | ||
run: pnpm build --zip --target=${{ matrix.browser }}-mv3 | ||
- name: Upload to GitHub Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.browser }}-mv3 | ||
path: build/ | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: build/ | ||
- name: Browser Platform Publish | ||
uses: PlasmoHQ/bpp@v3 | ||
with: | ||
verbose: ${{ inputs.dry-run }} | ||
keys: | | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/plasmo-corp/bpp/v3/keys.schema.json", | ||
"chrome": { | ||
"zip": "build/chrome-mv3.zip", | ||
"clientId": "${{ secrets.CHROME_CLIENT_ID }}", | ||
"clientSecret": "${{ secrets.CHROME_CLIENT_SECRET }}", | ||
"refreshToken": "${{ secrets.CHROME_REFRESH_TOKEN }}", | ||
"extId": "nhomlepkjglilcahfcfnggebkaabeiog", | ||
"uploadOnly": ${{ inputs.dry-run }} | ||
}, | ||
"edge": { | ||
"zip": "build/edge-mv3.zip", | ||
"clientId": "${{ secrets.EDGE_CLIENT_ID }}", | ||
"clientSecret": "${{ secrets.EDGE_CLIENT_SECRET}}", | ||
"productId": "${{ secrets.EDGE_PRODUCT_ID }}", | ||
"accessTokenUrl": "${{ secrets.EDGE_ACCESS_TOKEN_URL }}" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
name: Publish Extensions | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
description: 'dry run mode, will upload to the store but not publish' | ||
type: boolean | ||
required: false | ||
default: true | ||
|
||
jobs: | ||
build: | ||
|
@@ -19,26 +25,47 @@ jobs: | |
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
run: pnpm install --frozen-lockfile | ||
- name: Build And Package Extensions | ||
run: pnpm build --zip --target=${{ matrix.browser }}-mv3 | ||
# upload to github artifacts for each browser with matrix | ||
- name: Upload to GitHub Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.browser }}-mv3.zip | ||
name: ${{ matrix.browser }}-mv3 | ||
path: build/ | ||
publish: | ||
publish-chrome: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
# download artifacts | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: chrome-mv3 | ||
path: build/ | ||
# publish with BPP | ||
- name: Browser Platform Publish | ||
uses: PlasmoHQ/bpp@v3 | ||
- name: Upload Extension | ||
uses: mnao305/[email protected] | ||
with: | ||
keys: ${{ secrets.SUBMIT_KEYS }} | ||
file-path: build/chrome-mv3-prod.zip | ||
extension-id: nhomlepkjglilcahfcfnggebkaabeiog | ||
client-id: ${{ secrets.CHROME_CLIENT_ID }} | ||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} | ||
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} | ||
publish: ${{ !inputs.dry-run }} | ||
publish-edge: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: edge-mv3 | ||
path: build/ | ||
- name: Upload Extension | ||
uses: wdzeng/edge-addon@v1 | ||
with: | ||
product-id: ${{ secrets.EDGE_PRODUCT_ID }} | ||
zip-path: build/edge-mv3-prod.zip | ||
client-id: ${{ secrets.EDGE_CLIENT_ID }} | ||
client-secret: ${{ secrets.EDGE_CLIENT_SECRET }} | ||
access-token-url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }} | ||
upload-only: ${{ inputs.dry-run }} |