Skip to content

Commit 159e31e

Browse files
committed
build(cd): add chrome web store deployment
1 parent 83c06a2 commit 159e31e

5 files changed

Lines changed: 48 additions & 4 deletions

File tree

.github/workflows/chrome.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: chrome
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "apps/chrome/**"
9+
- "packages/server/**"
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
environment: deploy-chrome
15+
defaults:
16+
run:
17+
working-directory: ./apps/chrome
18+
19+
steps:
20+
- name: 💾 Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: 📦 Setup bun
24+
uses: oven-sh/setup-bun@v2
25+
26+
- name: 📦 Install dependencies
27+
run: bun ci
28+
29+
- name: 🛠️ Build the Chrome Extension
30+
run: bun run build
31+
32+
- name: 🚀 Upload to Chrome Web Store
33+
uses: mobilefirstllc/cws-publish@latest
34+
with:
35+
action: "upload" # one of: upload, publish, testers
36+
client_id: ${{ secrets.CLIENT }}
37+
client_secret: ${{ secrets.SECRET }}
38+
refresh_token: ${{ secrets.TOKEN }}
39+
extension_id: "bbhdnidgcmmpihfimomooiaojnaeedlj"
40+
zip_file: "./apps/chrome/release/release.zip"

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424

2525
build:
2626
runs-on: ubuntu-latest
27+
needs: check
2728

2829
steps:
2930
- name: 💾 Checkout code

.github/workflows/scraper.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: ./apps/scraper
1316
environment: deploy-scraper
1417

1518
steps:
@@ -23,6 +26,6 @@ jobs:
2326
run: bun install
2427

2528
- name: 🚀 Deploy to Cloudflare Workers
26-
run: cd ./apps/scraper && bun run deploy
29+
run: bun run deploy
2730
env:
2831
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

apps/chrome/manifest.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { defineManifest } from "@crxjs/vite-plugin";
2+
import pkgRoot from "../../package.json";
23
import pkg from "./package.json";
34

45
export default defineManifest({
56
manifest_version: 3,
6-
name: pkg.name,
7+
name: pkgRoot.name,
78
version: pkg.version,
89
icons: {
910
48: "public/logo.png",

apps/chrome/vite.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import react from "@vitejs/plugin-react";
55
import { defineConfig } from "vite";
66
import zip from "vite-plugin-zip-pack";
77
import manifest from "./manifest.config.js";
8-
import { name, version } from "./package.json";
98

109
export default defineConfig({
1110
resolve: {
@@ -17,7 +16,7 @@ export default defineConfig({
1716
react(),
1817
tailwindcss(),
1918
crx({ manifest }),
20-
zip({ outDir: "release", outFileName: `crx-${name}-${version}.zip` }),
19+
zip({ outDir: "release", outFileName: `release.zip` }),
2120
],
2221
server: {
2322
cors: {

0 commit comments

Comments
 (0)