mirror of https://github.com/halo-dev/halo
Add build script for ui project
Signed-off-by: John Niang <johnniang@foxmail.com>pull/5314/head
parent
15f7fe2d4f
commit
a3772fab1b
|
@ -27,9 +27,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- name: Setup Environment
|
||||
uses: ./.github/actions/setup-env
|
||||
- name: Check Halo console
|
||||
run: make -C console check
|
||||
- name: Check Halo core
|
||||
- name: Check Halo
|
||||
run: ./gradlew check
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
|
@ -42,8 +40,6 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- name: Setup Environment
|
||||
uses: ./.github/actions/setup-env
|
||||
- name: Build Halo console
|
||||
run: make -C console build
|
||||
- name: Reset version of Halo
|
||||
if: github.event_name == 'release'
|
||||
shell: bash
|
||||
|
@ -52,7 +48,7 @@ jobs:
|
|||
version=${{ github.event.release.tag_name }}
|
||||
version=${version#v}
|
||||
sed -i "s/version=.*-SNAPSHOT$/version=$version/1" gradle.properties
|
||||
- name: Build Halo core
|
||||
- name: Build Halo
|
||||
run: ./gradlew clean && ./gradlew downloadPluginPresets && ./gradlew build -x check
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
@ -82,6 +82,11 @@ tasks.register('createChecksums', Checksum) {
|
|||
checksumAlgorithm = Checksum.Algorithm.SHA256
|
||||
}
|
||||
|
||||
tasks.named('processResources', ProcessResources) {
|
||||
from project(':ui').tasks.named('build')
|
||||
into layout.buildDirectory.dir('resources/main')
|
||||
}
|
||||
|
||||
tasks.named('build') {
|
||||
dependsOn tasks.named('createChecksums')
|
||||
}
|
||||
|
|
13
build.gradle
13
build.gradle
|
@ -1,13 +0,0 @@
|
|||
plugins {
|
||||
id "org.sonarqube" version "4.4.1.3373"
|
||||
}
|
||||
|
||||
group = "run.halo.app"
|
||||
|
||||
sonar {
|
||||
properties {
|
||||
property "sonar.projectKey", "halo-dev_halo"
|
||||
property "sonar.organization", "halo-dev"
|
||||
property "sonar.host.url", "https://sonarcloud.io"
|
||||
}
|
||||
}
|
|
@ -6,4 +6,4 @@ pluginManagement {
|
|||
}
|
||||
|
||||
rootProject.name = 'halo'
|
||||
include 'api', 'application', 'platform:application', 'platform:plugin'
|
||||
include 'api', 'application', 'platform:application', 'platform:plugin', 'ui'
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
plugins {
|
||||
id "com.github.node-gradle.node" version "7.0.1"
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete layout.buildDirectory
|
||||
delete fileTree('packages') {
|
||||
include '*/dist/**'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('build', PnpmTask) {
|
||||
dependsOn tasks.named('check'), tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'build']
|
||||
inputs.files(fileTree(layout.projectDirectory) {
|
||||
include 'console-src/**', 'uc-src/**', 'src/**', 'public/**', '*.js', '*.json', '*.yaml', 'index.html'
|
||||
exclude '**/node_modules/**', '**/build/**', '**/dist/**'
|
||||
})
|
||||
outputs.dir(layout.buildDirectory.dir('dist'))
|
||||
configure {
|
||||
shouldRunAfter tasks.named('clean')
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('buildPackages', PnpmTask) {
|
||||
dependsOn tasks.named('pnpmInstall')
|
||||
inputs.files(fileTree('packages') {
|
||||
exclude '**/node_modules/**', '**/dist/**'
|
||||
})
|
||||
inputs.file('package.json')
|
||||
pnpmCommand = ['run', 'build:packages']
|
||||
outputs.files(fileTree('packages') {
|
||||
include '*/dist/**'
|
||||
})
|
||||
}
|
||||
|
||||
tasks.register('test', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'test:unit']
|
||||
shouldRunAfter tasks.named('lint'), tasks.named('typecheck')
|
||||
}
|
||||
|
||||
tasks.register('lint', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'lint']
|
||||
}
|
||||
|
||||
tasks.register('typecheck', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'typecheck']
|
||||
}
|
||||
|
||||
tasks.register('check') {
|
||||
dependsOn tasks.named('lint'), tasks.named('typecheck'), tasks.named('test')
|
||||
}
|
||||
|
||||
tasks.register('dev', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'dev']
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
|
||||
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'",
|
||||
"typecheck": "vue-tsc --noEmit -p tsconfig.app.json --composite false && pnpm run typecheck:packages",
|
||||
"lint": "eslint './src' './console-src' './uc-src' --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore --max-warnings=0 && pnpm run lint:packages",
|
||||
"lint": "eslint './src' './console-src' './uc-src' --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore --max-warnings=0 -f html -o build/lint-result/index.html && pnpm run lint:packages",
|
||||
"prettier": "prettier --write './{src,uc-src,console-src}/**/*.{vue,js,jsx,ts,tsx,css,scss,json,yml,yaml,html}' && pnpm run prettier:packages",
|
||||
"typecheck:packages": "pnpm --parallel --filter \"./packages/**\" run typecheck",
|
||||
"lint:packages": "pnpm --parallel --filter \"./packages/**\" lint",
|
||||
|
|
|
@ -9,7 +9,7 @@ export default ({ mode }: { mode: string }) => {
|
|||
base: env.VITE_BASE_URL,
|
||||
entryFile: "/console-src/main.ts",
|
||||
port: 3000,
|
||||
outDir: path.resolve("../application/src/main/resources/console"),
|
||||
outDir: path.resolve("build/dist/console"),
|
||||
mode,
|
||||
plugins: [
|
||||
VueI18nPlugin({
|
||||
|
|
|
@ -8,7 +8,7 @@ export default ({ mode }: { mode: string }) => {
|
|||
base: "/uc/",
|
||||
entryFile: "/uc-src/main.ts",
|
||||
port: 4000,
|
||||
outDir: path.resolve("../application/src/main/resources/uc"),
|
||||
outDir: path.resolve("build/dist/uc"),
|
||||
mode,
|
||||
plugins: [
|
||||
VueI18nPlugin({
|
||||
|
|
|
@ -20,6 +20,8 @@ export default defineConfig({
|
|||
},
|
||||
test: {
|
||||
dir: "./src",
|
||||
reporters: "html",
|
||||
outputFile: "build/test-result/index.html",
|
||||
transformMode: {
|
||||
web: [/\.[jt]sx$/],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue