Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion dev-packages/e2e-tests/publish-packages.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import * as childProcess from 'child_process';
import { readFileSync } from 'fs';
import * as glob from 'glob';
import * as path from 'path';

const repositoryRoot = path.resolve(__dirname, '../..');

const version = (JSON.parse(readFileSync(path.join(__dirname, './package.json'), 'utf8')) as { version: string })
.version;

// Get absolute paths of all the packages we want to publish to the fake registry
const packageTarballPaths = glob.sync('packages/*/sentry-*.tgz', {
// Only include the current versions, to avoid getting old tarballs published as well
const packageTarballPaths = glob.sync(`packages/*/sentry-*-${version}.tgz`, {
cwd: repositoryRoot,
absolute: true,
});

if (packageTarballPaths.length === 0) {
// eslint-disable-next-line no-console
console.log(`No packages to publish for version ${version}, did you run "yarn build:tarballs"?`);
process.exit(1);
}

// Publish built packages to the fake registry
packageTarballPaths.forEach(tarballPath => {
// eslint-disable-next-line no-console
Expand Down
Loading