mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix
This commit is contained in:
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@@ -11,14 +11,11 @@ jobs:
|
|||||||
check-version:
|
check-version:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone Repository
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
GITHUB_URL=https://oauth:${{ secrets.NAPCAT_BUILD }}@github.com//NapNeko/NapCatQQ
|
with:
|
||||||
git clone --recurse-submodules ${GITHUB_URL} NapCatQQ
|
ref: main
|
||||||
git config --global init.defaultBranch main
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
git config --global user.name "CheckVersion"
|
|
||||||
git config --global user.email "bot@noreply.github.com"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Extract version from tag
|
- name: Extract version from tag
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||||
@@ -28,14 +25,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version: 20.x
|
||||||
|
|
||||||
- name: Clone Check Version
|
- name: Check Version
|
||||||
run: |
|
run: |
|
||||||
cd ./NapCatQQ
|
ls
|
||||||
node ./script/checkVersion.cjs
|
node ./script/checkVersion.cjs
|
||||||
sh ./checkVersion.cjs
|
sh ./checkVersion.sh
|
||||||
cd ..
|
|
||||||
|
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
needs: [check-version]
|
needs: [check-version]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
let fs = require("fs");
|
let fs = require("fs");
|
||||||
let process = require("process")
|
let process = require("process")
|
||||||
console.log("[NapCat] [CheckVersion] 开始检测当前仓库版本...");
|
console.log("[NapCat] [CheckVersion] 开始检测当前仓库版本...");
|
||||||
|
|
||||||
let currentVersion = require("../package.json").version;
|
let currentVersion = require("../package.json").version;
|
||||||
let targetVersion = process.env.VERSION;
|
let targetVersion = process.env.VERSION;
|
||||||
console.log("[NapCat] [CheckVersion] currentVersion:", currentVersion, " targetVersion:", targetVersion);
|
console.log("[NapCat] [CheckVersion] currentVersion:", currentVersion, " targetVersion:", targetVersion);
|
||||||
@@ -12,5 +11,5 @@ if (currentVersion === targetVersion) {
|
|||||||
let packageJson = JSON.parse(fs.readFileSync("./package.json"));
|
let packageJson = JSON.parse(fs.readFileSync("./package.json"));
|
||||||
packageJson.version = targetVersion;
|
packageJson.version = targetVersion;
|
||||||
fs.writeFileSync("./package.json", JSON.stringify(packageJson));
|
fs.writeFileSync("./package.json", JSON.stringify(packageJson));
|
||||||
fs.writeFileSync("./checkVersion.sh", "#!/bin/bashe\ngit add .\n git commit -m \"chore:version change\"\n git push -u origin main")
|
fs.writeFileSync("./checkVersion.sh", "#!/bin/bashe\ngit config --global user.email \"bot@test.mail\"\n git config --global user.name \"Version\"\ngit add .\n git commit -m \"chore:version change\"\n git push -u origin main")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user