Skip to content

test: Avoid publishing old tarballs for E2E tests #16784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
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