Fix copyfiles for docsite (#1321)

This commit is contained in:
Evan Simkowitz 2024-11-19 14:15:11 -08:00 committed by GitHub
parent 7734d5dd30
commit 7c6fa91016
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 47 deletions

View File

@ -12,33 +12,8 @@ on:
env: env:
GO_VERSION: "1.22" GO_VERSION: "1.22"
NODE_VERSION: 22 NODE_VERSION: 22
STATIC_DOCSITE_PATH: docsite
jobs: jobs:
build-docsite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install Yarn
run: |
corepack enable
yarn install
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build embedded docsite
run: task docsite:build:embedded
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: docsite
path: docsite
build-app: build-app:
needs: build-docsite
outputs: outputs:
version: ${{ steps.set-version.outputs.WAVETERM_VERSION }} version: ${{ steps.set-version.outputs.WAVETERM_VERSION }}
strategy: strategy:
@ -131,19 +106,12 @@ jobs:
smctl windows certsync smctl windows certsync
shell: cmd shell: cmd
- name: Download embedded docsite
uses: actions/download-artifact@v4
with:
name: docsite
path: ${{env.STATIC_DOCSITE_PATH}}
# Build and upload packages # Build and upload packages
- name: Build (Linux) - name: Build (Linux)
if: matrix.platform == 'linux' if: matrix.platform == 'linux'
run: task package run: task package
env: env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one. USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
SNAPCRAFT_BUILD_ENVIRONMENT: host SNAPCRAFT_BUILD_ENVIRONMENT: host
- name: Build (Darwin) - name: Build (Darwin)
if: matrix.platform == 'darwin' if: matrix.platform == 'darwin'

View File

@ -77,17 +77,17 @@ tasks:
- storybook:build - storybook:build
docsite:build:embedded: docsite:build:embedded:
desc: Build the embedded docsite and copy it to ./docsite desc: Build the embedded docsite and copy it to dist/docsite
sources: sources:
- "docs/*" - "docs/*"
- "docs/src/**/*" - "docs/src/**/*"
- "docs/docs/**/*" - "docs/docs/**/*"
- "docs/static/**/*" - "docs/static/**/*"
generates: generates:
- "docsite/**/*" - "dist/docsite/**/*"
cmds: cmds:
- cd docs && yarn build-embedded - cd docs && yarn build-embedded
- task: copyfiles:'docs/build':'../docsite' - task: copyfiles:'docs/build':'dist/docsite'
deps: deps:
- yarn - yarn
@ -99,6 +99,7 @@ tasks:
- yarn build:prod && yarn electron-builder -c electron-builder.config.cjs -p never - yarn build:prod && yarn electron-builder -c electron-builder.config.cjs -p never
deps: deps:
- yarn - yarn
- docsite:build:embedded
- build:backend - build:backend
build:backend: build:backend:
@ -350,4 +351,4 @@ tasks:
copyfiles:*:*: copyfiles:*:*:
desc: Recursively copy directory and its contents. desc: Recursively copy directory and its contents.
internal: true internal: true
cmd: '{{if eq OS "windows"}}powershell Copy-Item -Recurse -Force -Path {{index .MATCH 0}} -Destination {{index .MATCH 1}}{{else}}cp -r {{index .MATCH 0}} {{index .MATCH 1}}{{end}}' cmd: '{{if eq OS "windows"}}powershell Copy-Item -Recurse -Force -Path {{index .MATCH 0}} -Destination {{index .MATCH 1}}{{else}}mkdir -p "$(dirname {{index .MATCH 1}})" && cp -r {{index .MATCH 0}} {{index .MATCH 1}}{{end}}'

View File

@ -109,14 +109,6 @@ const config = {
provider: "generic", provider: "generic",
url: "https://dl.waveterm.dev/releases-w2", url: "https://dl.waveterm.dev/releases-w2",
}, },
beforePack: () => {
const staticSourcePath = process.env.STATIC_DOCSITE_PATH;
const staticDestPath = "dist/docsite";
if (staticSourcePath) {
console.log(`Static docsite path is specified, copying from "${staticSourcePath}" to "${staticDestPath}"`);
fs.cpSync(staticSourcePath, staticDestPath, { recursive: true });
}
},
afterPack: (context) => { afterPack: (context) => {
// This is a workaround to restore file permissions to the wavesrv binaries on macOS after packaging the universal binary. // This is a workaround to restore file permissions to the wavesrv binaries on macOS after packaging the universal binary.
if (context.electronPlatformName === "darwin" && context.arch === Arch.universal) { if (context.electronPlatformName === "darwin" && context.arch === Arch.universal) {

View File

@ -3,14 +3,13 @@
import { atoms } from "@/store/global"; import { atoms } from "@/store/global";
import { FloatingPortal, useFloating, useInteractions } from "@floating-ui/react"; import { FloatingPortal, useFloating, useInteractions } from "@floating-ui/react";
import clsx from "clsx";
import { useAtomValue } from "jotai"; import { useAtomValue } from "jotai";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import "./notificationbubbles.less";
import { NotificationItem } from "./notificationitem"; import { NotificationItem } from "./notificationitem";
import { useNotification } from "./usenotification"; import { useNotification } from "./usenotification";
import clsx from "clsx";
import "./notificationBubbles.less";
const NotificationBubbles = () => { const NotificationBubbles = () => {
const { const {
notifications, notifications,