Skip to content

Commit

Permalink
修改github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hanaTsuk1 committed Jun 8, 2024
1 parent f889816 commit 2fdd31d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: release

on:
push:
branches:
- master
tags:
- 'v*'

Expand Down Expand Up @@ -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: '[email protected]'
user_name: hanaTsuk1
commit_message: update ${{ github.ref_name }}
3 changes: 3 additions & 0 deletions .vitepress/latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "0.11.4"
}
6 changes: 6 additions & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ 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) => {
config.version = version
fs.writeJsonSync(packagePath, config, {
spaces: 2,
})
fs.writeJsonSync(docConfigPath, {
version,
}, {
spaces: 2,
})
}

const program = new Command()
Expand Down

0 comments on commit 2fdd31d

Please sign in to comment.