Skip to content

Commit

Permalink
fix(@lexical/devtools): Fixed publish pipeline (#5973)
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleT authored Apr 27, 2024
1 parent 9df0da1 commit 32b346c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/devtools-extension-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Publish DevTools extension to stores

on:
workflow_dispatch:
inputs:
build_version:
description: 'Build version'
required: true
default: '0'
type: number

jobs:
release:
Expand All @@ -17,15 +23,16 @@ jobs:
cache: 'npm'

- uses: actions/cache@v3
id: cache
id: devtools-cache
with:
path: |
node_modules
packages/lexical-devtools/.wxt
~/.cache/ms-playwright
key: ${{ runner.os }}-${{ runner.arch }}v${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
if: steps.devtools-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Zip & submit to stores
Expand All @@ -38,3 +45,4 @@ jobs:
FIREFOX_EXTENSION_ID: ${{ secrets.EXTENSION_FIREFOX_EXTENSION_ID }}
FIREFOX_JWT_ISSUER: ${{ secrets.EXTENSION_FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.EXTENSION_FIREFOX_JWT_SECRET }}
BUILD_VERSION: ${{ inputs.build_version }}
13 changes: 13 additions & 0 deletions packages/lexical-devtools/wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
import babel from '@rollup/plugin-babel';
import react from '@vitejs/plugin-react';
import fs from 'fs';
import * as path from 'path';
import {defineConfig, UserManifest} from 'wxt';

Expand All @@ -19,6 +20,14 @@ export default defineConfig({
const browserName =
configEnv.browser.charAt(0).toUpperCase() + configEnv.browser.slice(1);

let buildVersion = 0; // For dev purposes
if (process.env.BUILD_VERSION) {
buildVersion = parseInt(process.env.BUILD_VERSION, 10);
}
if (isNaN(buildVersion)) {
throw new Error('BUILD_VERSION must be a number');
}

const manifestConf: UserManifest = {
author: 'Lexical',
description: `Adds Lexical debugging tools to the ${browserName} Developer Tools.`,
Expand All @@ -31,6 +40,10 @@ export default defineConfig({
},
name: 'Lexical Developer Tools',
permissions: ['scripting', 'storage', 'tabs'],
version:
JSON.parse(
fs.readFileSync(path.resolve(__dirname, 'package.json')).toString(),
).version + `.${buildVersion}`,
web_accessible_resources: [
{
extension_ids: [],
Expand Down

0 comments on commit 32b346c

Please sign in to comment.