From 2fdd31d117f34a9ee8d634b43c3ed32c0068897e Mon Sep 17 00:00:00 2001 From: hanaTsuk1 <101488209+hanaTsuk1@users.noreply.github.com> Date: Sat, 8 Jun 2024 10:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9github=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yaml | 14 ++++++++++++++ .vitepress/latest.json | 3 +++ scripts/release.js | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 .vitepress/latest.json diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c07543eb..b4111faf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,8 @@ name: release on: push: + branches: + - master tags: - 'v*' @@ -46,3 +48,15 @@ jobs: releaseName: v__VERSION__ prerelease: ${{ contains(github.ref_name, '-') }} args: -c src-tauri/tauri.conf.build.json + + - name: Push docs repository config file + uses: dmnemec/copy_file_to_another_repo_action@main + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + with: + source_file: .vitepress/latest.json + destination_repo: shion-app/docs + destination_folder: .vitepress + user_email: '101488209+hanaTsuk1@users.noreply.github.com' + user_name: hanaTsuk1 + commit_message: update ${{ github.ref_name }} diff --git a/.vitepress/latest.json b/.vitepress/latest.json new file mode 100644 index 00000000..02dae0be --- /dev/null +++ b/.vitepress/latest.json @@ -0,0 +1,3 @@ +{ + "version": "0.11.4" +} diff --git a/scripts/release.js b/scripts/release.js index e8e5b6c8..82d4ad12 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -11,6 +11,7 @@ const run = (bin, args, opts = {}) => execa(bin, args, { stdio: 'inherit', ...opts }) const packagePath = path.join(path.dirname(fileURLToPath(import.meta.url)), '../package.json') +const docConfigPath = path.join(path.dirname(fileURLToPath(import.meta.url)), '../.vitepress/latest.json') const config = fs.readJsonSync(packagePath) const repleaceVersion = (version) => { @@ -18,6 +19,11 @@ const repleaceVersion = (version) => { fs.writeJsonSync(packagePath, config, { spaces: 2, }) + fs.writeJsonSync(docConfigPath, { + version, + }, { + spaces: 2, + }) } const program = new Command()