aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-03-30 22:21:37 -0700
committerDhravya <[email protected]>2024-03-30 22:21:37 -0700
commite68675f3be4425200bb8841d9845bb67c8172e7d (patch)
tree2e685fd8fec9f15abafe7e12374cabfee7db00e4
parentuntracked .next/ (diff)
downloadsupermemory-e68675f3be4425200bb8841d9845bb67c8172e7d.tar.xz
supermemory-e68675f3be4425200bb8841d9845bb67c8172e7d.zip
added build and release github actions
-rw-r--r--.github/actions/buildextension/action.yml30
-rw-r--r--.github/workflows/build.yml14
-rw-r--r--.github/workflows/release.yml30
-rw-r--r--apps/extension/package.json2
4 files changed, 75 insertions, 1 deletions
diff --git a/.github/actions/buildextension/action.yml b/.github/actions/buildextension/action.yml
new file mode 100644
index 00000000..fcb3da87
--- /dev/null
+++ b/.github/actions/buildextension/action.yml
@@ -0,0 +1,30 @@
+name: 'Build Chrome extension'
+description: 'Builds the chrome extension into a ZIP'
+runs:
+ using: 'composite'
+ steps:
+ - name: Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+
+ - name: Install packages
+ run: npm ci
+ working-directory: apps/extension
+ shell: bash
+
+ - name: Build extension
+ run: npm run build
+ working-directory: apps/extension
+ shell: bash
+
+ - name: Pack extension
+ working-directory: apps/extension/dist
+ run: zip -r ../../extension-${{ github.event.pull_request.head.sha }}.zip *
+ shell: bash
+
+ - name: Upload extension archive
+ uses: actions/upload-artifact@v3
+ with:
+ name: extension-${{ github.sha }}
+ path: apps/extension/extension-${{ github.event.pull_request.head.sha }}.zip
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..9b46e802
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,14 @@
+name: Build
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ build-extension:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: ./.github/actions/buildextension
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..1d74978f
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,30 @@
+name: Upload to Web Store
+on:
+ push:
+ tags:
+ - '*'
+jobs:
+ build-extension:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: ./.github/actions/buildextension
+
+ upload-extension:
+ runs-on: ubuntu-latest
+ needs: build-extension
+ steps:
+ - name: Download extension archive
+ uses: actions/download-artifact@v3
+ with:
+ name: extension-${{ github.sha }}
+
+ - name: Upload to webstore
+ uses: ExtensionNinja/extension-publish@main
+ with:
+ action: upload
+ extensionID: INSERT_YOUR_EXTENSION_ID
+ clientID: ${{ secrets.GOOGLE_CLIENT_ID }}
+ clientSecret: ${{ secrets.GOOGLE_CLIENT_SECRET }}
+ clientRefreshToken: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
+ extensionFile: apps/extension/extension-${{ github.event.pull_request.head.sha }}.zip \ No newline at end of file
diff --git a/apps/extension/package.json b/apps/extension/package.json
index dc9b757a..95957e47 100644
--- a/apps/extension/package.json
+++ b/apps/extension/package.json
@@ -27,4 +27,4 @@
"typescript": "^5.2.2",
"vite": "^5.1.4"
}
-}
+} \ No newline at end of file