Skip to content

Commit 2fdd31d

Browse files
committed
修改github actions
1 parent f889816 commit 2fdd31d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.github/workflows/release.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: release
22

33
on:
44
push:
5+
branches:
6+
- master
57
tags:
68
- 'v*'
79

@@ -46,3 +48,15 @@ jobs:
4648
releaseName: v__VERSION__
4749
prerelease: ${{ contains(github.ref_name, '-') }}
4850
args: -c src-tauri/tauri.conf.build.json
51+
52+
- name: Push docs repository config file
53+
uses: dmnemec/copy_file_to_another_repo_action@main
54+
env:
55+
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
56+
with:
57+
source_file: .vitepress/latest.json
58+
destination_repo: shion-app/docs
59+
destination_folder: .vitepress
60+
user_email: '[email protected]'
61+
user_name: hanaTsuk1
62+
commit_message: update ${{ github.ref_name }}

.vitepress/latest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "0.11.4"
3+
}

scripts/release.js

+6
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ const run = (bin, args, opts = {}) =>
1111
execa(bin, args, { stdio: 'inherit', ...opts })
1212

1313
const packagePath = path.join(path.dirname(fileURLToPath(import.meta.url)), '../package.json')
14+
const docConfigPath = path.join(path.dirname(fileURLToPath(import.meta.url)), '../.vitepress/latest.json')
1415
const config = fs.readJsonSync(packagePath)
1516

1617
const repleaceVersion = (version) => {
1718
config.version = version
1819
fs.writeJsonSync(packagePath, config, {
1920
spaces: 2,
2021
})
22+
fs.writeJsonSync(docConfigPath, {
23+
version,
24+
}, {
25+
spaces: 2,
26+
})
2127
}
2228

2329
const program = new Command()

0 commit comments

Comments
 (0)