Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
eemmiillyy committed Jul 18, 2024
1 parent ba9a21b commit df74102
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
14 changes: 14 additions & 0 deletions scripts/install-deb-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set -e -o pipefail

# This will sign files after `oclif pack:deb`, this script should be ran from
# the `dist/deb` folder
echo "$DEBIAN_GPG_KEY_PRIVATE" | base64 -d 2> /dev/null | gpg --import --batch --passphrase "$DEBIAN_GPG_KEY_PASS" 2> /dev/null
gpg --digest-algo SHA512 --clearsign --pinentry-mode loopback --passphrase "$DEBIAN_GPG_KEY_PASS" -u $DEBIAN_GPG_KEY_ID -o InRelease Release 2> /dev/null
gpg --digest-algo SHA512 -abs --pinentry-mode loopback --passphrase "$DEBIAN_GPG_KEY_PASS" -u $DEBIAN_GPG_KEY_ID -o Release.gpg Release 2> /dev/null
echo "Signed debian packages successfully"
echo "sha256 sums:"
sha256sum *Release*


mkdir -p $RUNNER_TEMP/cli/dist/apt
echo "$DEBIAN_GPG_KEY_PUBLIC" | base64 --decode > $RUNNER_TEMP/cli/dist/apt/release.key
31 changes: 10 additions & 21 deletions scripts/release-cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createExportableManifest } from '@pnpm/exportable-manifest';
import { readProjectManifest } from '@pnpm/read-project-manifest';
import { writeProjectManifest } from '@pnpm/write-project-manifest';
import { execFile, exec as execRaw } from 'child_process';
import { execFile, execFileSync, exec as execRaw } from 'child_process';
import { Octokit } from '@octokit/core';
import fs from 'fs';
import * as util from 'util';
Expand Down Expand Up @@ -87,7 +87,7 @@ async function main() {
//Packages
await exec(`pnpm oclif pack ${operatingSystem}`);
if (operatingSystem === 'deb') {
await installDebCert();
installDebCert();
}
// Upload Tarballs
await uploadS3(operatingSystem);
Expand Down Expand Up @@ -186,23 +186,12 @@ const promoteS3 = async (platform: 'macos' | 'deb' | 'win', version: string) =>
};

// # This will sign files after `oclif pack deb`, this script should be ran from the `dist/deb` folder
const installDebCert = async () => {
await exec(`export GPG_TTY=$(tty)`);
await exec(`echo "$DEBIAN_GPG_KEY_PRIVATE" exists....`);
await exec(
`echo "$DEBIAN_GPG_KEY_PRIVATE" | base64 -d 2> /dev/null | gpg --import --batch --passphrase "$DEBIAN_GPG_KEY_PASS" 2> /dev/null`
);
await exec(
`gpg --digest-algo SHA512 --clearsign --pinentry-mode loopback --passphrase "$DEBIAN_GPG_KEY_PASS" -u $DEBIAN_GPG_KEY_ID -o InRelease Release 2> /dev/null`
);
await exec(
`gpg --digest-algo SHA512 -abs --pinentry-mode loopback --passphrase "$DEBIAN_GPG_KEY_PASS" -u $DEBIAN_GPG_KEY_ID -o Release`
);
await exec(`echo "Signed debian packages successfully"`);
await exec(`echo "sha256 sums:"`);
await exec(`sha256sum *Release*`);
await exec(`
mkdir -p ./dist/deb/release.key
`);
await exec(`echo "$DEBIAN_GPG_KEY_PUBLIC" | base64 --decode > ./dist/deb/release.key`);
const installDebCert = () => {
execFileSync('./install-deb-cert.sh', {
stdio: 'inherit',
cwd: `${PATH_TO_CLI}/dist/deb`,
env: {
...process.env
}
});
};

0 comments on commit df74102

Please sign in to comment.