1
This commit is contained in:
41
.github/workflows/pr-test.yml
vendored
Normal file
41
.github/workflows/pr-test.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: PR Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test & Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: pnpm/action-setup@v5
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
- name: Run tests
|
||||
run: pnpm test
|
||||
|
||||
- name: Build Chrome
|
||||
run: pnpm build
|
||||
|
||||
- name: Build Firefox
|
||||
run: pnpm build:firefox
|
||||
79
.github/workflows/submit.yml
vendored
Normal file
79
.github/workflows/submit.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
name: Submit to Stores
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Release tag to submit (e.g., v1.0.0)"
|
||||
required: true
|
||||
type: string
|
||||
dryRun:
|
||||
description: Dry run (build + zip but skip submission)
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
targets:
|
||||
description: Which stores to submit to
|
||||
required: true
|
||||
default: chrome-firefox
|
||||
type: choice
|
||||
options:
|
||||
- chrome-firefox
|
||||
- chrome
|
||||
- firefox
|
||||
|
||||
jobs:
|
||||
submit:
|
||||
name: Submit to Stores
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout release tag
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ inputs.tag }}
|
||||
|
||||
- uses: pnpm/action-setup@v5
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run tests
|
||||
run: pnpm test
|
||||
|
||||
- name: Build and zip
|
||||
run: pnpm zip:all
|
||||
|
||||
- name: Upload zips to GitHub release
|
||||
run: |
|
||||
gh release upload "${{ inputs.tag }}" \
|
||||
.output/*-chrome.zip \
|
||||
.output/*-firefox.zip \
|
||||
.output/*-sources.zip \
|
||||
--clobber
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Submit to Chrome Web Store
|
||||
if: inputs.targets != 'firefox' && !inputs.dryRun
|
||||
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: Submit to Firefox AMO
|
||||
if: inputs.targets != 'chrome' && !inputs.dryRun
|
||||
run: |
|
||||
pnpm wxt submit \
|
||||
--firefox-zip .output/*-firefox.zip \
|
||||
--firefox-sources-zip .output/*-sources.zip
|
||||
env:
|
||||
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
|
||||
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
|
||||
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
|
||||
Reference in New Issue
Block a user