Skip to content
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

Fix CI issues after yarn 4 update #3896

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
cache: 'yarn'

- name: Build documentation
run: ./scripts/build-documentation.sh # output in website/build
run: yarn && ./scripts/build-documentation.sh # output in website/build
- name: Check Output
run: find ./website/build
- name: Upload artifact
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"ms": "~2.1.3"
},
"devDependencies": {
"@terascope/scripts": "~1.8.1",
"@terascope/scripts": "~1.9.0",
"@terascope/types": "~1.4.1",
"bunyan": "~1.8.15",
"elasticsearch-store": "~1.7.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@eslint/js": "~9.16.0",
"@swc/core": "1.4.0",
"@swc/jest": "~0.2.36",
"@terascope/scripts": "~1.8.1",
"@terascope/scripts": "~1.9.0",
"@types/bluebird": "~3.5.42",
"@types/convict": "~6.1.6",
"@types/elasticsearch": "~5.0.43",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/scripts",
"displayName": "Scripts",
"version": "1.8.1",
"version": "1.9.0",
"description": "A collection of terascope monorepo scripts",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/scripts#readme",
"bugs": {
Expand Down
12 changes: 3 additions & 9 deletions packages/scripts/src/helpers/publish/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
get, concat, pMap,
concat, pMap,
isString, toHumanTime
} from '@terascope/utils';
import { PackageInfo } from '../interfaces.js';
Expand All @@ -11,7 +11,7 @@ import {
} from './utils.js';
import {
yarnPublish, yarnRun, remoteDockerImageExists,
dockerBuild, dockerPush, yarnPublishV2,
dockerBuild, dockerPush,
getNodeVersionFromImage
} from '../scripts.js';
import { getRootInfo, getDevDockerImage, formatList } from '../misc.js';
Expand Down Expand Up @@ -69,13 +69,7 @@ async function npmPublish(
return pkgInfo.name;
}

const rootInfo = getRootInfo();
if (rootInfo.terascope.version === 2) {
await yarnPublishV2(pkgInfo, tag);
} else {
const registry: string | undefined = get(pkgInfo, 'publishConfig.registry');
await yarnPublish(pkgInfo, tag, registry);
}
await yarnPublish(pkgInfo, tag);
return pkgInfo.name;
}

Expand Down
29 changes: 2 additions & 27 deletions packages/scripts/src/helpers/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,42 +586,17 @@ export function mapToArgs(input: ArgsMap): string[] {
}

/**
* Yarn publish for version 2
* Yarn publish for yarn versions 2, 3, and 4
*/
export async function yarnPublishV2(
pkgInfo: PackageInfo,
tag = 'latest',
): Promise<void> {
await fork({
cmd: 'yarn',
args: [
'npm',
'publish',
'--tag',
tag
],
cwd: pkgInfo.dir,
env: {
NODE_ENV: 'production'
}
});
}

export async function yarnPublish(
pkgInfo: PackageInfo,
tag = 'latest',
registry = config.NPM_DEFAULT_REGISTRY
): Promise<void> {
await fork({
cmd: 'yarn',
args: [
'npm',
'publish',
'--non-interactive',
'--new-version',
pkgInfo.version,
'--no-git-tag-version',
'--registry',
registry,
'--tag',
tag
],
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main() {
yarn setup &&
yarn docs &&
cd website &&
yarn install --prod --no-default-rc &&
yarn install &&
yarn run build
}

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2941,7 +2941,7 @@ __metadata:
languageName: unknown
linkType: soft

"@terascope/scripts@npm:~1.8.1, @terascope/scripts@workspace:packages/scripts":
"@terascope/scripts@npm:~1.9.0, @terascope/scripts@workspace:packages/scripts":
version: 0.0.0-use.local
resolution: "@terascope/scripts@workspace:packages/scripts"
dependencies:
Expand Down Expand Up @@ -6261,7 +6261,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "e2e@workspace:e2e"
dependencies:
"@terascope/scripts": "npm:~1.8.1"
"@terascope/scripts": "npm:~1.9.0"
"@terascope/types": "npm:~1.4.1"
bunyan: "npm:~1.8.15"
elasticsearch-store: "npm:~1.7.1"
Expand Down Expand Up @@ -13226,7 +13226,7 @@ __metadata:
"@eslint/js": "npm:~9.16.0"
"@swc/core": "npm:1.4.0"
"@swc/jest": "npm:~0.2.36"
"@terascope/scripts": "npm:~1.8.1"
"@terascope/scripts": "npm:~1.9.0"
"@types/bluebird": "npm:~3.5.42"
"@types/convict": "npm:~6.1.6"
"@types/elasticsearch": "npm:~5.0.43"
Expand Down
Loading