fix: update public/static to /static

This commit is contained in:
Tienson Qin
2025-07-02 21:43:11 +08:00
parent 76a8f8ce62
commit 8a219cacc1
12 changed files with 21 additions and 160 deletions

View File

@@ -129,10 +129,10 @@ jobs:
- name: Prepare public Directory
run: |
cp -r static public/
rm -rvf public/static/js/publishing
rm -rvf public/static/js/*.js.map || true
rm -rvf public/static/*.*
rm -rvf public/static/ios
rm -rvf public/js/publishing
rm -rvf public/js/*.js.map || true
rm -rvf public/*.*
rm -rvf public/ios
rm -rvf android/app/src/main/assets/public || true
- name: Sync public to Android Project

View File

@@ -1,68 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: Build-Demo
on:
workflow_dispatch:
inputs:
git-ref:
description: "Release Git Ref (Which branch or tag to build?)"
required: true
default: "master"
cloudflare-project-name:
description: "Cloudflare pages project name"
required: true
default: "logseq-demo"
release:
types: [released]
env:
CLOJURE_VERSION: '1.11.1.1413'
NODE_VERSION: '20'
JAVA_VERSION: '17'
jobs:
build:
runs-on: ubuntu-latest
env:
asset-path: ${GITHUB_REF##*/}/static/js/
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup clojure
uses: DeLaGuardo/setup-clojure@10.1
with:
cli: ${{ env.CLOJURE_VERSION }}
- name: Fetch yarn deps
run: yarn cache clean && yarn install --frozen-lockfile
- name: Build Released-Web
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge '{:asset-path "${{env.asset-path}}" :compiler-options {:source-map-include-sources-content false :source-map-detail-level :symbols}}'
ls -ah ./public
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2553ea8236c11ea0f88de28fce1cbfee
projectName: ${{ github.event.inputs.cloudflare-project-name || 'logseq-demo' }}
directory: 'static'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: 'production'

View File

@@ -62,7 +62,7 @@ jobs:
LOGSEQ_POSTHOG_TOKEN: ${{ secrets.LOGSEQ_POSTHOG_TOKEN }}
- name: Sync static build files
run: rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android ./static/ ./public/static/
run: rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android ./static/ ./public/
- name: Prepare iOS build
run: npx cap sync ios

View File

@@ -72,7 +72,7 @@ jobs:
run: yarn install && yarn release-app
- name: Sync static build files
run: rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android ./static/ ./public/static/
run: rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android ./static/ ./public/
- name: Prepare iOS build
run: npx cap sync ios

View File

@@ -1,71 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: Build-Stage
on:
workflow_dispatch:
inputs:
git-ref:
description: "Release Git Ref (Which branch or tag to build?)"
required: true
default: "master"
cloudflare-project-name:
description: "Cloudflare pages project name"
required: true
default: "logseq-dev"
release:
types: [released]
env:
CLOJURE_VERSION: '1.11.1.1413'
NODE_VERSION: '20'
JAVA_VERSION: '17'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup clojure
uses: DeLaGuardo/setup-clojure@10.1
with:
cli: ${{ env.CLOJURE_VERSION }}
- name: Fetch yarn deps
run: yarn cache clean && yarn install --frozen-lockfile
- name: Set Build Environment Variables
run: |
echo "ENABLE_FILE_SYNC_PRODUCTION=false" >> $GITHUB_ENV
- name: Build Released-Web
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge '{:compiler-options {:source-map true :source-map-include-sources-content false :source-map-detail-level :symbols}}'
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/static/
ls -lR ./public
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2553ea8236c11ea0f88de28fce1cbfee
projectName: ${{ github.event.inputs.cloudflare-project-name || 'logseq-dev' }}
directory: 'public'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: 'production'

View File

@@ -79,7 +79,7 @@ jobs:
- name: Prepare E2E test build
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge "{:closure-defines {frontend.config/DEV-RELEASE true}}" --debug
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/static/
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/
ls -lR ./public
- name: Run e2e tests

View File

@@ -80,7 +80,7 @@ jobs:
- name: Prepare E2E test build
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge "{:closure-defines {frontend.config/DEV-RELEASE true}}" --debug
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/static/
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/
ls -lR ./public
- name: Run e2e tests

View File

@@ -43,9 +43,9 @@ jobs:
- name: Build Released-Web
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge '{:compiler-options {:source-map true :source-map-include-sources-content true :source-map-detail-level :symbols}}'
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/static/
ls -lR ./public && mkdir r2 && mv ./public/static/js/main.js.map ./r2/db-test.main.js.map
sed -i 's/=main.js.map/=https:\/\/assets.logseq.io\/db-test.main.js.map/g' ./public/static/js/main.js
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/
ls -lR ./public && mkdir r2 && mv ./public/js/main.js.map ./r2/db-test.main.js.map
sed -i 's/=main.js.map/=https:\/\/assets.logseq.io\/db-test.main.js.map/g' ./public/js/main.js
env:
LOGSEQ_SENTRY_DSN: ${{ secrets.LOGSEQ_SENTRY_DSN }}
LOGSEQ_POSTHOG_TOKEN: ${{ secrets.LOGSEQ_POSTHOG_TOKEN }}

1
.gitignore vendored
View File

@@ -61,6 +61,7 @@ android/app/src/main/assets/capacitor.config.json
*.sublime-*
/public/static
/public/
.yarn/
.yarnrc.yml

View File

@@ -5,11 +5,11 @@ e2e tests for Logseq app.
## Usage
Before running tests, ensure the following:
* The app's js and css assets are built and located at ../public/static/.
* The app's js and css assets are built and located at ../public/.
* Those assets are served on http://localhost:3002/ via `bb serve`.
Then, run the project's tests:
$ clojure -T:build test
If you would like to run individual tests, pass options to the test runner through `clojure -M:test`. For example, add a `^:focus` on a test and then run `clojure -M:test -i focus`.
If you would like to run individual tests, pass options to the test runner through `clojure -M:test`. For example, add a `^:focus` on a test and then run `clojure -M:test -i focus`.

View File

@@ -191,7 +191,7 @@ const common = {
}),
})
cp.execSync(`rm -rf ios/App/App/public/static/out`, {
cp.execSync(`rm -rf ios/App/App/public/out`, {
stdio: 'inherit',
})

View File

@@ -1,7 +1,7 @@
(ns logseq.tasks.dev.mobile
"Tasks for mobile development"
(:require [babashka.tasks :refer [shell]]
[babashka.fs :as fs]
(:require [babashka.fs :as fs]
[babashka.tasks :refer [shell]]
[clojure.string :as string]
[logseq.tasks.util :as task-util]))
@@ -15,10 +15,10 @@
(shell cmd)
(println "Waiting for app to build..."))
(Thread/sleep 1000)
(when-not (or (and (fs/exists? "ios/App/App/public/static/js/main.js")
(task-util/file-modified-later-than? "ios/App/App/public/static/js/main.js" start-time))
(and (fs/exists? "android/App/src/main/assets/public/static/js/main.js")
(task-util/file-modified-later-than? "android/App/src/main/assets/public/static/js/main.js" start-time)))
(when-not (or (and (fs/exists? "ios/App/App/public/js/main.js")
(task-util/file-modified-later-than? "ios/App/App/public/js/main.js" start-time))
(and (fs/exists? "android/App/src/main/assets/public/js/main.js")
(task-util/file-modified-later-than? "android/App/src/main/assets/public/js/main.js" start-time)))
(recur (dec n))))))
(defn- set-system-env
@@ -38,7 +38,6 @@
(string/replace "// }" " }"))]
(spit "capacitor.config.ts" new-body))))
(defn app-watch
"Watches environment to reload cljs, css and other assets for mobile"
[]