From b2da2ffc4fc443e588501b449084a40d8d34b63c Mon Sep 17 00:00:00 2001 From: zerlei <1445089819@qq.com> Date: Sun, 13 Oct 2024 11:56:54 +0800 Subject: [PATCH] CI/CD: modify workflow --- .github/workflows/build.yaml | 21 ++++++++++---------- Tool/JsScript/test.js | 37 ------------------------------------ Tool/webtool/package.json | 2 +- 3 files changed, 11 insertions(+), 49 deletions(-) delete mode 100644 Tool/JsScript/test.js diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2595d1a..461335a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,8 +1,6 @@ name: buildProject on: push: - branches: - - "main" tags: - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 @@ -15,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use NodeJs + - name: Setup NodeJs uses: actions/setup-node@v4 with: node-version: 22.x @@ -25,22 +23,23 @@ jobs: dotnet-version: 8.0.x - name: build run: | + mkdir release + mkdir release/LocalServer/wwwroot + mkdir release/RemoteServer + mkdir release/JsScript cd Tool/webtool npm install npm run build cd ../../Server dotnet restore cd LocalServer - dotnet publish --no-restore + dotnet publish -o ../../release/Localserver --no-restore cd ../RemoteServer - dotnet publish --no-restore + dotnet publish -o ../../release/RemoteServer --no-restore cd ../../ - name: Package run: | - mkdir release - mv -Path "Server/LocalServer/bin/Release/net8.0/publish/*" -Destination "release/LocalServer" - mv -Path "Server/RemoteServer/bin/Release/net8.0/publish/*" -Destination "release/RemoteServer" - cp Tool/JsScript/* release/JsScript + cp Tool/JsScript/* release/JsScript/ Compress-Archive -Path "release/*" -DestinationPath "FS_win_dotnet8.zip" -Force - name: Release uses: softprops/action-gh-release@v2 @@ -49,6 +48,6 @@ jobs: files: | FS_win_dotnet8.zip LICENSE - name: Release ${{ github.ref }} - draft: true + name: ${{ github.ref }} + draft: false prerelease: true diff --git a/Tool/JsScript/test.js b/Tool/JsScript/test.js deleted file mode 100644 index 182ed42..0000000 --- a/Tool/JsScript/test.js +++ /dev/null @@ -1,37 +0,0 @@ -// import WebSocket from 'ws'; - -// const wsUrl = 'wss://toolin.cn/echo'; -// const ws = new WebSocket(wsUrl); - -// ws.on('open', () => { -// console.log('Connected to WebSocket server'); -// ws.send("赵磊f",(err)=>{ -// console.log(err) -// }) - -// }); - -// ws.on('message', (message) => { -// var str = message.toString('utf8') -// if(str.includes("赵磊f")) { -// ws.close() -// } -// console.log('Received message:',str); -// }); - -// ws.on('close', () => { -// console.log('Disconnected from WebSocket server'); -// }); - -import chalk from 'chalk'; -function logProgress(current, total) { - const progressPercentage = (current / total) * 100; - var str = `Progress: ${progressPercentage.toFixed(2)}%\r` - var x = chalk['red'](str); - process.stdout.write(x); -} - -// Example usage: -setInterval(() => { - logProgress(Math.floor(Math.random() * 100), 100); -}, 100); // Update progress every 100 milliseconds with a random value diff --git a/Tool/webtool/package.json b/Tool/webtool/package.json index 78e8d56..f832001 100644 --- a/Tool/webtool/package.json +++ b/Tool/webtool/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build --outDir ../../Server/LocalServer/wwwroot/", + "build": "vite build --outDir ../../release/LocalServer/wwwroot/", "preview": "vite preview" }, "dependencies": {