From cac464cc65f6cc3b8a0428fc168e48a4f25a6e08 Mon Sep 17 00:00:00 2001 From: bytedream Date: Sat, 8 Nov 2025 18:14:22 +0100 Subject: [PATCH] update actions --- .github/workflows/build.yml | 3 +- .github/workflows/lint.yml | 27 ++++++++-------- .github/workflows/publish.yml | 61 +++++++++++++++++++++++++++++++++++ wxt.config.ts | 3 ++ 4 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 737e93e..da07963 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,8 @@ jobs: - name: Checkout uses: actions/checkout@v5 - - uses: actions/setup-node@v6 + - name: Setup node + uses: actions/setup-node@v6 with: node-version: 22 cache: 'npm' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b112895..d5b3062 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,19 +5,20 @@ on: pull_request: jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v5 + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 - - uses: actions/setup-node@v6 - with: - node-version: 22 - cache: 'npm' + - name: Setup node + uses: actions/setup-node@v6 + with: + node-version: 22 + cache: 'npm' - - name: Install dependencies - run: npm ci + - name: Install dependencies + run: npm ci - - name: Lint - run: npm run lint + - name: Lint + run: npm run lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..15635b1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,61 @@ +name: publish + +on: + push: + tags: + - v* + workflow_dispatch: + inputs: + dry_run: + type: boolean + description: Dry run + default: true + +permissions: + contents: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Setup node + uses: actions/setup-node@v6 + with: + node-version: 22 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Zip extensions + run: | + npm run zip:firefox + npm run zip + + - name: Upload to latest release + if: github.event.inputs.dry_run != 'true' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: .output/*.zip + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Submit to stores + env: + DRY_RUN: ${{ github.event.inputs.dry_run }} + FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} + FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }} + FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }} + 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 }} + run: | + wxt submit \ + --firefox-zip .output/*-mv2.zip --firefox-sources-zip .output/*-sources.zip \ + --chrome-zip .output/*-mv3.zip diff --git a/wxt.config.ts b/wxt.config.ts index 7c1667f..f8774d1 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -29,6 +29,9 @@ export default defineConfig({ permissions: ['storage', ...(manifestVersion === 2 ? ['webRequest', 'webRequestBlocking', ''] : [])], optional_permissions: ['nativeMessaging'] }), + zip: { + artifactTemplate: '{{name}}-{{version}}-{{manifestVersion}}.zip' + }, vite: () => ({ define: {