Skip to content

chore(cli): set npm dist tag #350

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
Oct 8, 2024
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.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Publish package
run: |
rm -rf .npmrc && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN_KOOBIQ" > ~/.npmrc
npm run release:publish:ci-github
npm run release:publish:ci-github -- -t v17-lts
env:
NPM_TOKEN_KOOBIQ: ${{ secrets.NPM_PUBLISH_TOKEN }}
MATTERMOST_ENDPOINT_URL: ${{ secrets.MM_WEBHOOK_URL }}
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const runCliCommands = () => {
.option('-p, --project-dir <string>', 'project root directory', process.env['RELEASE_PROJECT'] ?? ROOT_DIR)
.option('-d, --dist-dir <string>', 'packages dist directory', process.env['RELEASE_DIST'] ?? DIST_DIR)
.option('-c, --changelog-scope <string>', 'default changelog scope', process.env['CHANGELOG_SCOPE'] ?? 'koobiq')
.option('-t, --tag-name <string>', 'Name of the NPM dist tag.', 'latest')
.option('-n, --without-references', 'exclude changelog links', false)
.option('-n, --without-notification', 'cancel mattermost notifications', false)
.option('-o, --repo-owner <string>', 'github owner name', process.env['REPO_OWNER'] ?? 'koobiq')
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/release/base-release-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface IReleaseTaskConfig {
projectDir: string;
repoToken: string;
distDir: string;
tagName: string;
repoOwner: string;
repoName: string;
repoUrl: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/release/publish-release-github-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class PublishReleaseCIGithubTask extends BaseReleaseTask {

this.checkReleaseOutput();

const npmDistTag = 'latest';
const npmDistTag = this.config.tagName;

for (const packageName of this.packageJson.release.packages) {
this.publishPackageToNpm(packageName, npmDistTag);
Expand Down Expand Up @@ -84,7 +84,7 @@ export class PublishReleaseCIGithubTask extends BaseReleaseTask {

/** Publishes the specified package within the given NPM dist tag. */
private publishPackageToNpm(packageName: string, npmDistTag: string) {
console.info(green(` ⭮ Publishing "${packageName}"..`));
console.info(green(` ⭮ Publishing "${packageName}" with tag ${npmDistTag}..`));

const errorOutput = npmPublish(join(this.releaseOutputPath, packageName), npmDistTag);

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/release/publish-release-gitlab-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class PublishReleaseCIGitlabTask extends BaseReleaseTask {

this.checkReleaseOutput();

const npmDistTag = 'latest';
const npmDistTag = this.config.tagName;

for (const packageName of this.packageJson.release.packages) {
this.publishPackageToNpm(packageName, npmDistTag);
Expand Down Expand Up @@ -84,7 +84,7 @@ export class PublishReleaseCIGitlabTask extends BaseReleaseTask {

/** Publishes the specified package within the given NPM dist tag. */
private publishPackageToNpm(packageName: string, npmDistTag: string) {
console.info(green(` ⭮ Publishing "${packageName}"..`));
console.info(green(` ⭮ Publishing "${packageName}" with tag ${npmDistTag}..`));

const errorOutput = npmPublish(join(this.releaseOutputPath, packageName), npmDistTag);

Expand Down
Loading