3 Commits

3 changed files with 21 additions and 14 deletions

18
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "artix-metro", "name": "artix-metro",
"version": "3.1.2", "version": "3.1.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "artix-metro", "name": "artix-metro",
"version": "3.1.2", "version": "3.1.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"artix-checkupdates": "1.0.2", "artix-checkupdates": "1.0.2",
@@ -21,7 +21,7 @@
"devDependencies": { "devDependencies": {
"@sindresorhus/tsconfig": "7.0.0", "@sindresorhus/tsconfig": "7.0.0",
"@types/cli-color": "2.0.6", "@types/cli-color": "2.0.6",
"@types/node": "22.13.10", "@types/node": "22.13.13",
"typescript": "5.8.2" "typescript": "5.8.2"
} }
}, },
@@ -63,9 +63,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "22.13.10", "version": "22.13.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz",
"integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -758,9 +758,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "22.13.10", "version": "22.13.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz",
"integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", "integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"undici-types": "~6.20.0" "undici-types": "~6.20.0"

View File

@@ -1,6 +1,6 @@
{ {
"name": "artix-metro", "name": "artix-metro",
"version": "3.1.2", "version": "3.1.3",
"description": "Automate pushing packages to Artix", "description": "Automate pushing packages to Artix",
"keywords": [ "keywords": [
"artix", "artix",
@@ -41,6 +41,6 @@
"typescript": "5.8.2", "typescript": "5.8.2",
"@sindresorhus/tsconfig": "7.0.0", "@sindresorhus/tsconfig": "7.0.0",
"@types/cli-color": "2.0.6", "@types/cli-color": "2.0.6",
"@types/node": "22.13.10" "@types/node": "22.13.13"
} }
} }

View File

@@ -55,14 +55,21 @@ class Pusher {
} }
async refreshGpg() { async refreshGpg() {
if (await isPasswordRequired()) { const sshSignMode = 'SSHKEYSIGN' in process.env;
if (sshSignMode || await isPasswordRequired()) {
console.log(clc.cyan('Refreshing signature...')); console.log(clc.cyan('Refreshing signature...'));
this._createdSignfile ||= await runCommand('touch', [SIGNFILE]); this._createdSignfile ||= await runCommand('touch', [SIGNFILE]);
await runCommand('gpg', ['-a', '--passphrase', escapeCommandParam(this._config.gpgpass || ''), '--batch', '--pinentry-mode', 'loopback', '--detach-sign', SIGNFILE]); if (sshSignMode) {
await fsp.rm(`${SIGNFILE}.asc`); await runCommand('ssh-keygen', ['-Y', 'sign', '-f', path.resolve(process.env['SSHKEYSIGN'] as string), '-n', ' git', SIGNFILE]);
}
else {
await runCommand('gpg', ['-a', '--passphrase', escapeCommandParam(this._config.gpgpass || ''), '--batch', '--pinentry-mode', 'loopback', '--detach-sign', SIGNFILE]);
}
await fsp.rm(`${SIGNFILE}.${sshSignMode ? 'sig' : 'asc'}`)
} }
} }
increment(pkg: string): Promise<void> { increment(pkg: string): Promise<void> {
return new Promise(async (res, _) => { return new Promise(async (res, _) => {
const pkgbuild = path.join(this._artools.workspace, 'artixlinux', pkg, 'PKGBUILD'); const pkgbuild = path.join(this._artools.workspace, 'artixlinux', pkg, 'PKGBUILD');