Skip to content

Commit

Permalink
test gh
Browse files Browse the repository at this point in the history
  • Loading branch information
eemmiillyy committed Jul 19, 2024
1 parent 73d572e commit c6b84d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
18 changes: 9 additions & 9 deletions scripts/release-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ async function main() {
if (!process.env.GITHUB_TOKEN) throw new Error('GITHUB_TOKEN is not set');
// if (!process.env.PUBLISHED_PACKAGES) throw new Error('PUBLISHED_PACKAGES is not set');
if (!process.env.COMMIT_SHA) throw new Error('COMMIT_SHA is not set');

// if (!publishedPackagesContains(process.env.PUBLISHED_PACKAGES, '@xata.io/cli')) return;

const operatingSystem = matrixToOclif(process.env.OS_OVERRIDE ?? process.env.MATRIX_OS);
Expand All @@ -50,7 +51,6 @@ async function main() {

// Assume changeset version has been called and all the
// versions in package jsons are up to date

const {
manifest: { version }
} = await readProjectManifest(PATH_TO_CLI);
Expand Down Expand Up @@ -84,7 +84,7 @@ async function main() {

// Tarballs
await exec(`pnpm oclif pack tarballs --targets=${platformDistributions(operatingSystem)}`);
//Packages
// Installers
await exec(`pnpm oclif pack ${operatingSystem}`);

const octokit = new Octokit({
Expand All @@ -101,13 +101,13 @@ async function main() {
if (!release.data) throw new Error('Release not found');

const pathToAsset = `${PATH_TO_CLI}/dist/${operatingSystem}`;
// Debian pack results in redundant files. Only upload .deb files
// const files = fs
// .readdirSync(pathToAsset)
// .filter((file) => (operatingSystem === 'deb' ? file.endsWith('.deb') : true));
// for (const file of files) {
// // await uploadFiles({ pathToFile: pathToAsset + `/${file}`, fileName: file, octokit, releaseId: release.data.id });
// }
// Debian pack results in redundant installer files. Only upload .deb files
const files = fs
.readdirSync(pathToAsset)
.filter((file) => (operatingSystem === 'deb' ? file.endsWith('.deb') : true));
for (const file of files) {
await uploadFiles({ pathToFile: pathToAsset + `/${file}`, fileName: file, octokit, releaseId: release.data.id });
}
}

const uploadFiles = async ({
Expand Down
5 changes: 3 additions & 2 deletions scripts/upload-promote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ async function main() {

process.chdir(PATH_TO_CLI);

// Upload Tarballs
// Upload tarballs
await uploadS3(operatingSystem);
// Upload packages
// Upload installers
await uploadS3(operatingSystem, { pkg: true });
// Promote to stable
await promoteS3(operatingSystem, version);
}
main();
Expand Down

0 comments on commit c6b84d6

Please sign in to comment.