From 9cb3be7c6e48347d2be58b375d4d1eee18d726ce Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Wed, 23 Aug 2023 21:46:17 +0800 Subject: [PATCH] feat(aklive2d): remove versioning --- .github/workflows/gh-pages.yaml | 6 ------ Version | 1 - aklive2d.js | 2 -- config/_project_json.yaml | 5 ----- directory/Version | 1 - libs/config.js | 7 ------- libs/content_processor.js | 4 ---- libs/version.js | 15 --------------- vite.config.js | 5 ----- 9 files changed, 46 deletions(-) delete mode 100644 Version delete mode 100644 directory/Version delete mode 100644 libs/version.js diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index 171690f..ff01ea6 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -9,8 +9,6 @@ jobs: runs-on: ubuntu-latest - if: "contains(github.event.head_commit.message, 'release')" - permissions: contents: write @@ -26,10 +24,6 @@ jobs: run: pnpm run build-all - name: Build directory run: pnpm run vite:directory:build - - name: Commit version changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "chore(aklive2d): auto update build versions" - name: Deploy uses: s0/git-publish-subdir-action@develop env: diff --git a/Version b/Version deleted file mode 100644 index 00e897b..0000000 --- a/Version +++ /dev/null @@ -1 +0,0 @@ -3.8.2 \ No newline at end of file diff --git a/aklive2d.js b/aklive2d.js index ab88387..e425eff 100644 --- a/aklive2d.js +++ b/aklive2d.js @@ -11,7 +11,6 @@ import { write, rmdir, copy, writeSync, copyDir, readdirSync, exists } from './l import AssetsProcessor from './libs/assets_processor.js' import init from './libs/initializer.js' import directory from './libs/directory.js' -import { increase } from './libs/version.js'; import Background from './libs/background.js' import CharwordTable from './libs/charword_table.js'; import Music from './libs/music.js'; @@ -39,7 +38,6 @@ async function main() { fork(path.join(__projectRoot, 'vite.config.js'), [op, OPERATOR_NAMES]) return case 'build-all': - __config.version.showcase = increase(__projectRoot) case 'charwords:build': for (const [key,] of Object.entries(__config.operators)) { OPERATOR_NAMES.push(key) diff --git a/config/_project_json.yaml b/config/_project_json.yaml index 85fd1b2..99de8d6 100644 --- a/config/_project_json.yaml +++ b/config/_project_json.yaml @@ -6,7 +6,6 @@ localization: ui_notice_set_fps: Set FPS target in Settings ui_notice_github: "Github: https://gura.ch/aklive2d-gh" ui_notice_other_operators: "Previews: https://gura.ch/aklive2d" - ui_notice_version: !match "~{version('Version: ', '')}" ui_background_title:

🖼️ Background


ui_custom_background: Custom Background ui_default_background: Default Background @@ -45,7 +44,6 @@ localization: ui_notice_set_fps: 在设置中设定FPS目标 ui_notice_github: "Github: https://gura.ch/aklive2d-gh" ui_notice_other_operators: "预览: https://gura.ch/aklive2d" - ui_notice_version: !match "~{version('版本: ', '')}" ui_background_title:

🖼️ 背景


ui_custom_background: 背景图片 ui_default_background: 默认背景 @@ -94,9 +92,6 @@ properties: - key: notice_other_operators value: text: ui_notice_other_operators - - key: notice_version - value: - text: ui_notice_version - key: logo_title value: text: ui_logo_title diff --git a/directory/Version b/directory/Version deleted file mode 100644 index c9929e3..0000000 --- a/directory/Version +++ /dev/null @@ -1 +0,0 @@ -1.4.2 \ No newline at end of file diff --git a/libs/config.js b/libs/config.js index e8ecbc0..b3462c2 100644 --- a/libs/config.js +++ b/libs/config.js @@ -1,7 +1,6 @@ /* eslint-disable no-undef */ import path from 'path' import { read } from './yaml.js' -import { read as readVersion } from './version.js' import { getOperatorId } from './charword_table.js' export default function () { @@ -22,11 +21,5 @@ function process(config) { operator.id = getOperatorId(operator).replace(/^(char_)(\d+)(_.+)$/g, '$2') } - // version - config.version = { - showcase: readVersion(path.join(__projectRoot)), - directory: readVersion(path.join(__projectRoot, 'directory')), - } - return config } \ No newline at end of file diff --git a/libs/content_processor.js b/libs/content_processor.js index 3c24ea8..42142e0 100644 --- a/libs/content_processor.js +++ b/libs/content_processor.js @@ -49,10 +49,6 @@ class Evalable { return this.#step(location, varName) } - version(prefix, suffix) { - return `${prefix}${__config.version.showcase}${suffix}` - } - #step(location, varName) { let content = this.#config if (location === 'assets') content = this.#assets diff --git a/libs/version.js b/libs/version.js deleted file mode 100644 index 90ea96c..0000000 --- a/libs/version.js +++ /dev/null @@ -1,15 +0,0 @@ -import path from 'path' -import { readSync, writeSync } from './file.js' - -export function read (dir) { - return readSync(path.join(dir, 'Version')) -} - -export function increase(dir) { - // release version will be lagged by 0.0.1 - const version = read(dir) - const [major, minor, patch] = version.split('.') - const newVersion = `${major}.${minor}.${+patch + 1}` - writeSync(newVersion, path.join(dir, 'Version')) - return newVersion -} diff --git a/vite.config.js b/vite.config.js index 22b8440..43f2df4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,7 +6,6 @@ import assert from 'assert' import react from '@vitejs/plugin-react-swc' import getConfig from './libs/config.js' import { rmdir } from './libs/file.js' -import { increase } from './libs/version.js' import Music from './libs/music.js'; import Background from './libs/background.js' import directory from './libs/directory.js' @@ -37,7 +36,6 @@ class ViteRunner { case 'directory': result = { data: this.#directoryConfig, - versionDir: path.join(__projectRoot, "directory"), } const op = temp[2] || process.argv[3] if (op !== 'preview') { @@ -51,7 +49,6 @@ class ViteRunner { case 'preview': result = { data: this.#operatorConfig, - versionDir: path.join(__projectRoot), } break default: @@ -69,7 +66,6 @@ class ViteRunner { this.#dev(viteConfig) break case 'build': - this.#globalConfig.version.showcase = increase(configObj.versionDir) case 'build-all': this.#build(viteConfig) break @@ -147,7 +143,6 @@ class ViteRunner { get #directoryConfig() { if (process.env.npm_lifecycle_event === 'vite:directory:build') { - this.#globalConfig.version.directory = increase(path.join(__projectRoot, "directory")) global.__config = this.#globalConfig } const directoryDir = path.resolve(__projectRoot, 'directory')