mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-10-26 13:00:31 +00:00
添加版本脚本
This commit is contained in:
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -11,13 +11,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: denoland/setup-deno@v2
|
|
||||||
with:
|
|
||||||
deno-version: v2.x
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
run: |
|
run: |
|
||||||
export TZ=Asia/Shanghai
|
export TZ=Asia/Shanghai
|
||||||
TAG="v$(deno run -q version).$(date +%y%m%d%H%M)"
|
TAG="v$(npm run -s version).$(date +%y%m%d%H%M)"
|
||||||
gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
|
gh release create "$TAG" dist/* --notes-file .github/release.md --draft -t $TAG
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"commit": "npm run lint && npm run format && npm run build"
|
"commit": "npm run lint && npm run format && npm run build",
|
||||||
|
"version": "node scripts/version.cjs"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-react": "^7.27.1",
|
"@babel/preset-react": "^7.27.1",
|
||||||
|
|||||||
8
scripts/version.cjs
Normal file
8
scripts/version.cjs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const pkgPath = path.join(__dirname, '..', 'package.json');
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(pkgPath));
|
||||||
|
|
||||||
|
const version = pkg.version;
|
||||||
|
console.log(version);
|
||||||
Reference in New Issue
Block a user