Skip to content

Release v1.8.1: report link layout fix on the beta layout, wxt 0.21 a… #3

Release v1.8.1: report link layout fix on the beta layout, wxt 0.21 a…

Release v1.8.1: report link layout fix on the beta layout, wxt 0.21 a… #3

Workflow file for this run

name: Publish
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- ".github/**"
- ".gitignore"
- ".editorconfig"
- ".prettierrc"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
outputs:
should_publish: ${{ steps.check.outputs.should_publish }}
has_chrome: ${{ steps.chrome.outputs.has_chrome }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Read version from package.json
id: version
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
# The semver workflow already enforces a version bump on every PR to
# main, but guard on the tag so re-runs and non-version pushes (or a
# manual dispatch) never submit the same version twice.
- name: Skip if version already released
id: check
run: |
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "Tag v${{ steps.version.outputs.version }} already exists - nothing to publish."
echo "should_publish=false" >> "$GITHUB_OUTPUT"
else
echo "should_publish=true" >> "$GITHUB_OUTPUT"
fi
# `secrets` is not available in job-level `if:`, so resolve the Chrome
# token gate here and expose it as an output the chrome job can read.
- name: Detect Chrome credentials
id: chrome
run: |
if [ -n "${{ secrets.CHROME_REFRESH_TOKEN }}" ]; then
echo "has_chrome=true" >> "$GITHUB_OUTPUT"
else
echo "Chrome refresh token not set - skipping Chrome publish."
echo "has_chrome=false" >> "$GITHUB_OUTPUT"
fi
# Firefox and Chrome publish as independent jobs so a failure in one store
# never blocks the other, and "Re-run failed jobs" retries only the store
# that failed instead of re-submitting a version that already went through.
firefox:
needs: check
if: needs.check.outputs.should_publish == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: lts/*
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build & zip (Firefox + sources)
run: pnpm zip:firefox
- name: Submit to Firefox Add-ons
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 }}
FIREFOX_CHANNEL: ${{ secrets.FIREFOX_CHANNEL }}
chrome:
needs: check
if: needs.check.outputs.should_publish == 'true' && needs.check.outputs.has_chrome == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: lts/*
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build & zip (Chrome)
run: pnpm zip
- name: Submit to Chrome Web Store
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 }}
CHROME_PUBLISH_TARGET: ${{ secrets.CHROME_PUBLISH_TARGET }}
CHROME_SKIP_SUBMIT_REVIEW: ${{ secrets.CHROME_SKIP_SUBMIT_REVIEW }}
# Only tag and release once the stores are done. Runs when Firefox succeeded
# and Chrome either succeeded or was skipped (no token yet). If either store
# failed, the release is held back so a retry can complete it before tagging.
release:
needs: [check, firefox, chrome]
if: >-
${{ !cancelled()
&& needs.check.outputs.should_publish == 'true'
&& needs.firefox.result == 'success'
&& (needs.chrome.result == 'success' || needs.chrome.result == 'skipped') }}
runs-on: ubuntu-latest
permissions:
contents: write
env:
VERSION: ${{ needs.check.outputs.version }}
steps:
- uses: actions/checkout@v7
- name: Tag and create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag "v$VERSION"
git push origin "v$VERSION"
gh release create "v$VERSION" --title "v$VERSION" --generate-notes