diff --git a/.github/workflows/browser-extension.yml b/.github/workflows/browser-extension.yml index 35685d8..c66bc50 100644 --- a/.github/workflows/browser-extension.yml +++ b/.github/workflows/browser-extension.yml @@ -13,6 +13,7 @@ jobs: - uses: actions/checkout@v5 with: submodules: recursive + fetch-depth: 0 - uses: pnpm/action-setup@v4 with: version: 10 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..67832d3 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +on: + workflow_dispatch: + inputs: + to_publish: + description: 'What to publish' + required: true + default: 'all' + type: choice + options: + - all + - chrome + - edge +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + - uses: pnpm/action-setup@v4 + with: + version: 10 + - uses: actions/setup-node@v5 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + - run: pnpm install --frozen-lockfile + - run: pnpm wxt zip + - name: wxt submit chrome + if: "${{ github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'chrome' }}" + run: pnpm wxt submit --chrome-zip .output/*-chrome.zip \ + env: + CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }} + CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }} + CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }} + CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }} + - name: wxt submit edge + if: "${{ github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'edge' }}" + run: pnpm wxt submit --edge-zip .output/*-chrome.zip \ + env: + EDGE_PRODUCT_ID: ${{ secrets.EDGE_PRODUCT_ID }} + EDGE_CLIENT_ID: ${{ secrets.EDGE_CLIENT_ID }} + EDGE_CLIENT_SECRET: ${{ secrets.EDGE_CLIENT_SECRET }} + EDGE_ACCESS_TOKEN_URL: ${{ secrets.EDGE_ACCESS_TOKEN_URL }} \ No newline at end of file diff --git a/src/lib/config.ts b/src/lib/config.ts index 1a1819a..3c02277 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -1,4 +1,4 @@ -const MODES = ["PROD", "PLAYGROUNDS_PR"] as const +const MODES = ["PROD"] as const export type ModeType = (typeof MODES)[number] @@ -8,6 +8,8 @@ export type LogLevel = (typeof LOG_LEVELS)[number] export const CONFIG = { EXTENSION_NAME: "gitcasso", // decorates logs - LOG_LEVEL: "DEBUG" satisfies LogLevel, + LOG_LEVEL: (import.meta.env.MODE === "production" + ? "WARN" + : "DEBUG") satisfies LogLevel, MODE: "PROD" satisfies ModeType, } as const diff --git a/wxt.config.ts b/wxt.config.ts index bedd05b..86c4815 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ 128: "/icons/icon-128.png", }, name: "Gitcasso", - permissions: ["activeTab", "tabs"], + permissions: ["activeTab"], version: "0.2.0", }, modules: ["@wxt-dev/webextension-polyfill"],