chore: update CI & other misc changes

This commit is contained in:
Andrei O 2024-08-29 04:37:40 +03:00
parent 03ba0c8f14
commit c8e83c163a
No known key found for this signature in database
GPG Key ID: B961E5B68389457E
6 changed files with 40 additions and 34 deletions

Binary file not shown.

View File

@ -9,7 +9,7 @@
"typescript": "^5.0.0" "typescript": "^5.0.0"
}, },
"dependencies": { "dependencies": {
"farcaster-hub-utils": "^0.1.7", "farcaster-hub-utils": "^0.1.8",
"yup-api-interact": "^0.1.6" "yup-api-interact": "^0.1.6"
}, },
"license": "MIT" "license": "MIT"

View File

@ -1,6 +1,6 @@
{ {
"name": "clear-wallet", "name": "clear-wallet",
"version": "1.4.3", "version": "1.4.4",
"private": true, "private": true,
"description": "Clear Wallet (CLW) is a wallet that helps you manage your Ethereum assets and interact with Ethereum dApps and contracts with the main focus on absolute privacy.", "description": "Clear Wallet (CLW) is a wallet that helps you manage your Ethereum assets and interact with Ethereum dApps and contracts with the main focus on absolute privacy.",
"type": "module", "type": "module",
@ -10,6 +10,7 @@
"content": "tsc --outFile src/extension/content.js src/extension/content.ts", "content": "tsc --outFile src/extension/content.js src/extension/content.ts",
"post-build": "yarn tsx ./release-scripts/post-build.ts", "post-build": "yarn tsx ./release-scripts/post-build.ts",
"build": "yarn inject && yarn content && vue-tsc --noEmit && vite build && yarn post-build", "build": "yarn inject && yarn content && vue-tsc --noEmit && vite build && yarn post-build",
"rebuild": "yarn build && yarn tsx ./release-scripts/create-release.ts rebuild",
"preview": "vite preview", "preview": "vite preview",
"release": "yarn config set version-tag-prefix clear-wallet@v && yarn config set version-git-message 'clear-wallet@v%s' && yarn version --patch && yarn postversion", "release": "yarn config set version-tag-prefix clear-wallet@v && yarn config set version-git-message 'clear-wallet@v%s' && yarn version --patch && yarn postversion",
"postversion": "git push", "postversion": "git push",

View File

@ -1,10 +1,10 @@
const pFs = import('fs') const pFs = import('fs')
const pCps = import ('child_process') const pCps = import('child_process')
async function ghRelease(changes: string[]) { async function ghRelease (changes: string[], isRebuild: boolean) {
const fs = (await pFs).default const fs = (await pFs).default
if (!fs.existsSync('releases')){ if (!fs.existsSync('releases')) {
fs.mkdirSync('releases'); fs.mkdirSync('releases');
} }
@ -32,29 +32,31 @@ async function ghRelease(changes: string[]) {
arch.finalize(); arch.finalize();
}); });
const changeLogPath = `releases/${pkg.version}.changelog.md`; if (!isRebuild) {
const changeLogPath = `releases/${pkg.version}.changelog.md`;
fs.writeFileSync( fs.writeFileSync(
changeLogPath, changeLogPath,
`# ${pkg.version} \n `# ${pkg.version} \n
${changes.reduce((acc: string, change: string) => { ${changes.reduce((acc: string, change: string) => {
return acc + `- ${change}\n`; return acc + `- ${change}\n`;
}, '')}`, }, '')}`,
); );
const cps = (await pCps) const cps = (await pCps)
console.log( console.log(
await new Promise((resolve) => { await new Promise((resolve) => {
const p = cps.spawn('gh', ['release', 'create', `v${pkg.version}`, `./${outputPath}`, '-F', `./${changeLogPath}`], { const p = cps.spawn('gh', ['release', 'create', `v${pkg.version}`, `./${outputPath}`, '-F', `./${changeLogPath}`], {
shell: true, shell: true,
}); });
let result = ''; let result = '';
p.stdout.on('data', (data) => (result += data.toString())); p.stdout.on('data', (data) => (result += data.toString()));
p.stderr.on('data', (data) => (result += data.toString())); p.stderr.on('data', (data) => (result += data.toString()));
p.on('close', () => { p.on('close', () => {
resolve(result); resolve(result);
}); });
}), }),
); );
}
} }
(async () => { (async () => {
@ -63,6 +65,9 @@ async function ghRelease(changes: string[]) {
return; return;
} }
const changes = process.argv[2].split(','); const changes = process.argv[2].split(',');
await ghRelease(changes);
const isRebuild = changes.includes('rebuild');
await ghRelease(changes, isRebuild);
console.log('Release created', changes); console.log('Release created', changes);
})(); })();

View File

@ -3,8 +3,8 @@
"name": "__MSG_appName__", "name": "__MSG_appName__",
"description": "__MSG_appDesc__", "description": "__MSG_appDesc__",
"default_locale": "en", "default_locale": "en",
"version": "1.4.3", "version": "1.4.4",
"version_name": "1.4.3", "version_name": "1.4.4",
"icons": { "icons": {
"16": "assets/extension-icon/wallet_16.png", "16": "assets/extension-icon/wallet_16.png",
"32": "assets/extension-icon/wallet_32.png", "32": "assets/extension-icon/wallet_32.png",

View File

@ -127,7 +127,7 @@
></ion-input> ></ion-input>
</ion-item> </ion-item>
<ion-item> <ion-item>
<ion-button @click="setGasLimit">Set Price</ion-button> <ion-button @click="setGasLimit">Set Limit</ion-button>
</ion-item> </ion-item>
</ion-list> </ion-list>
</ion-content> </ion-content>
@ -399,16 +399,16 @@ export default defineComponent({
interval = setInterval(setItervalFn, 1000) as any; interval = setInterval(setItervalFn, 1000) as any;
}); });
const setGasLimit = () => { const setGasLimit = async () => {
gasLimit.value = inGasLimit.value; gasLimit.value = inGasLimit.value;
newGasData(); await newGasData();
gasLimitModal.value = false; gasLimitModal.value = false;
}; };
const setGasPrice = () => { const setGasPrice = async () => {
gasPrice.value = inGasPrice.value; gasPrice.value = inGasPrice.value;
gasPriceReFetch.value = false; gasPriceReFetch.value = false;
newGasData(); await newGasData();
gasPriceModal.value = false; gasPriceModal.value = false;
}; };