Skip to content

Commit

Permalink
add ext publish gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Aug 16, 2022
1 parent 9bad4dd commit 0d7fa9a
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 15 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ jobs:
- name: Install Dependencies
run: pnpm install --no-frozen-lockfile

- name: Build and Test
run: pnpm build-test

- name: Upload & release Extension
uses: mnao305/chrome-extension-upload@3.0.0
with:
file-path: packages/extension/dist.zip
extension-id: kmcfjchnmmaeeagadbhoofajiopoceel
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
refresh-token: ${{ secrets.REFRESH_TOKEN }}

- name: Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
publish: pnpm run ci:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Thumbs.db
# chrome extension private key file
*.pem


packages/extension/dist.zip
14 changes: 14 additions & 0 deletions configs/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noEmit": true,
"isolatedModules": true,
"skipLibCheck": true
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"release": "pnpm run build-test && changeset publish",
"version-packages": "changeset version && pnpm i",
"ci:version": "changeset version && pnpm i --no-frozen-lockfile && git add .",
"ci:publish": "changeset publish",
"update-deps": "taze -w -r && pnpm i"
},
"devDependencies": {
Expand All @@ -30,6 +31,7 @@
"babel-preset-solid": "^1.4.8",
"esbuild": "^0.14.53",
"esbuild-plugin-solid": "^0.4.2",
"jiti": "^1.14.0",
"prettier": "2.7.0",
"solid-js": "^1.4.8",
"taze": "^0.7.6",
Expand Down
6 changes: 4 additions & 2 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"contributors": [],
"scripts": {
"dev": "vite --port 3333",
"build": "npm run clean && vite build",
"build": "npm run clean && vite build && jiti scripts/zip",
"clean": "rimraf ./dist",
"test": "echo \"NOOP TEST\"",
"typecheck": "tsc --noEmit"
Expand All @@ -17,10 +17,12 @@
"@types/chrome": "^0.0.193",
"@vanilla-extract/vite-plugin": "^3.3.0",
"esbuild-plugin-solid": "^0.4.2",
"jiti": "^1.14.0",
"rimraf": "^3.0.2",
"typescript": "^4.7.4",
"vite": "^3.0.4",
"vite-plugin-solid": "^2.3.0"
"vite-plugin-solid": "^2.3.0",
"zip-a-folder": "^1.1.5"
},
"dependencies": {
"@solid-devtools/shared": "workspace:^0.5.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/extension/scripts/postversion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { writeFileSync } from "fs"

writeFileSync("scripts/.needs-release", "")
6 changes: 6 additions & 0 deletions packages/extension/scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../../configs/tsconfig.base.json",
"compilerOptions": {
"types": ["node"]
}
}
3 changes: 3 additions & 0 deletions packages/extension/scripts/zip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { zip } from "zip-a-folder"

zip("dist", "dist.zip")
Loading

0 comments on commit 0d7fa9a

Please sign in to comment.