Skip to content

Commit

Permalink
chore: update release script
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Mar 6, 2023
1 parent 9cc5513 commit 69f5111
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"release": "npm-run-all -s electron:build:web electron:tsc && npx esno scripts/build.ts --publish=always && node scripts/upload.js",
"test": "npm-run-all --serial test:*",
"e2e": "cd test/e2e&&npx playwright test -c playwright.config.ts",
"test:e2e":"npm-run-all -s start:web test:e2e",
"test:e2e": "npm-run-all -s start:web test:e2e",
"clear:electron:tsc": "tsc --build --clean",
"electron:tsc": "tsc -p tsconfig.json",
"electron:dev": "npm run electron:tsc && electron . --development",
Expand Down
5 changes: 4 additions & 1 deletion scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ const signWindows = () => {
path: `D:\\git\\postcat\\release\\Postcat-Setup-${version}.exe`
};
await sign(...signOptions);
execSync('yarn releaseWindows');

if (argv.publish === 'always') {
execSync('yarn releaseWindows');
}

console.log('\x1b[32m', '打包完成🎉🎉🎉你要的都在 release 目录里🤪🤪🤪');
resolve(true);
Expand Down
8 changes: 1 addition & 7 deletions scripts/releaseWindows.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Octokit } from 'octokit';

import { readFileSync, writeFileSync } from 'fs';
import path from 'path';
import { readFileSync } from 'fs';

const version = process.env.npm_package_version;

Expand All @@ -18,11 +17,6 @@ const commonInfo = {
const setup = async () => {
const { data: releaseList } = await octokit.rest.repos.listReleases(commonInfo);

const latestPath = path.join(__dirname, '../release/latest.yml');
const file = readFileSync(latestPath, 'utf8');
// @ts-ignore
writeFileSync(latestPath, file.replaceAll(`Postcat-Setup-${version}.exe`, `Postcat Setup ${version}.exe`));

const assetNames = [`Postcat-Setup-${version}.exe`, 'latest.yml'];

// 获取id,upload_url,
Expand Down

0 comments on commit 69f5111

Please sign in to comment.