Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@lexical/devtools): Fixed publish pipeline #5973

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading