Skip to content

Commit 89c04b0

Browse files
authored
Merge pull request #700 from Quenty/users/quenty/more-ci-cd-fixes
fix: More CI/CD fixes, including nevermore templates failing CI release
2 parents cce55af + 95b7353 commit 89c04b0

9 files changed

Lines changed: 58 additions & 27 deletions

File tree

tools/nevermore-cli/src/commands/batch-command/batch-deploy-command.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type Reporter,
66
type LiveStateTracker,
77
CompositeReporter,
8+
GithubCommentTableReporter,
89
GroupedReporter,
910
JsonFileReporter,
1011
SpinnerReporter,
@@ -15,7 +16,10 @@ import { NevermoreGlobalArgs } from '../../args/global-args.js';
1516
import { getApiKeyAsync } from '@quenty/nevermore-cli-helpers';
1617
import { runBatchAsync } from '../../utils/batch/batch-runner.js';
1718
import { uploadPlaceAsync } from '../../utils/build/upload.js';
18-
import { type BatchDeployResult } from '../../utils/deploy/deploy-github-columns.js';
19+
import {
20+
type BatchDeployResult,
21+
createDeployCommentConfig,
22+
} from '../../utils/deploy/deploy-github-columns.js';
1923
import { OpenCloudClient } from '../../utils/open-cloud/open-cloud-client.js';
2024
import { RateLimiter } from '../../utils/open-cloud/rate-limiter.js';
2125
import { CloudJobContext } from '../../utils/job-context/cloud-job-context.js';
@@ -166,6 +170,15 @@ async function _runAsync(args: BatchDeployArgs): Promise<void> {
166170
if (args.output) {
167171
reporters.push(new JsonFileReporter(state, args.output));
168172
}
173+
if (isCI()) {
174+
reporters.push(
175+
new GithubCommentTableReporter(
176+
state,
177+
createDeployCommentConfig(),
178+
concurrency
179+
)
180+
);
181+
}
169182
return reporters;
170183
}
171184
);

tools/nevermore-cli/src/commands/deploy-command/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ import {
55
type Reporter,
66
type LiveStateTracker,
77
CompositeReporter,
8+
GithubCommentTableReporter,
89
JsonFileReporter,
910
SimpleReporter,
1011
SpinnerReporter,
1112
} from '@quenty/cli-output-helpers/reporting';
1213
import { NevermoreGlobalArgs } from '../../args/global-args.js';
1314
import { getApiKeyAsync } from '@quenty/nevermore-cli-helpers';
1415
import { uploadPlaceAsync } from '../../utils/build/upload.js';
16+
import { createDeployCommentConfig } from '../../utils/deploy/deploy-github-columns.js';
1517
import { OpenCloudClient } from '../../utils/open-cloud/open-cloud-client.js';
1618
import { RateLimiter } from '../../utils/open-cloud/rate-limiter.js';
1719
import { CloudJobContext } from '../../utils/job-context/cloud-job-context.js';
18-
import { readPackageNameAsync } from '../../utils/nevermore-cli-utils.js';
20+
import { isCI, readPackageNameAsync } from '../../utils/nevermore-cli-utils.js';
1921
import { handleInitAsync } from './deploy-init.js';
2022
import { selectTargetAsync } from './select-target.js';
2123

@@ -195,6 +197,15 @@ export class DeployCommand<T> implements CommandModule<T, DeployArgs> {
195197
if (args.output) {
196198
reporters.push(new JsonFileReporter(state, args.output));
197199
}
200+
if (isCI()) {
201+
reporters.push(
202+
new GithubCommentTableReporter(
203+
state,
204+
createDeployCommentConfig(),
205+
1
206+
)
207+
);
208+
}
198209
return reporters;
199210
}
200211
);

tools/nevermore-cli/src/commands/test-command/test-command.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { NevermoreGlobalArgs } from '../../args/global-args.js';
55
import { getApiKeyAsync } from '@quenty/nevermore-cli-helpers';
66
import { OpenCloudClient } from '../../utils/open-cloud/open-cloud-client.js';
77
import { RateLimiter } from '../../utils/open-cloud/rate-limiter.js';
8-
import { readPackageNameAsync } from '../../utils/nevermore-cli-utils.js';
8+
import { isCI, readPackageNameAsync } from '../../utils/nevermore-cli-utils.js';
99
import {
1010
CloudJobContext,
1111
LocalJobContext,
@@ -15,9 +15,11 @@ import {
1515
type Reporter,
1616
type LiveStateTracker,
1717
CompositeReporter,
18+
GithubCommentTableReporter,
1819
JsonFileReporter,
1920
SimpleReporter,
2021
SpinnerReporter,
22+
createTestCommentConfig,
2123
} from '../../utils/testing/reporting/index.js';
2224

2325
export interface TestProjectArgs extends NevermoreGlobalArgs {
@@ -110,6 +112,11 @@ export class TestProjectCommand<T>
110112
if (args.output) {
111113
reporters.push(new JsonFileReporter(state, args.output));
112114
}
115+
if (isCI()) {
116+
reporters.push(
117+
new GithubCommentTableReporter(state, createTestCommentConfig(), 1)
118+
);
119+
}
113120
return reporters;
114121
}
115122
);

tools/nevermore-cli/templates/game-template/.github/workflows/integration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ jobs:
5555
if: steps.check.outputs.enabled == 'true'
5656
run: |
5757
if [[ -n "$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" ]]; then
58-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
59-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
58+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
59+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
6060
fi
6161
6262
if [[ -n "$NPM_TOKEN" ]]; then
63-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
64-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
63+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
64+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
6565
fi
6666
env:
6767
NPM_GITHUB_QUENTYSTUDIOS_TOKEN: $\{{ secrets.NPM_GITHUB_QUENTYSTUDIOS_TOKEN }}

tools/nevermore-cli/templates/game-template/.github/workflows/linting.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
- name: Setup npm for GitHub Packages
2828
run: |
2929
if [[ -n "$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" ]]; then
30-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
31-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
30+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
31+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
3232
fi
3333
3434
if [[ -n "$NPM_TOKEN" ]]; then
35-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
36-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
35+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
36+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
3737
fi
3838
env:
3939
NPM_GITHUB_QUENTYSTUDIOS_TOKEN: $\{{ secrets.NPM_GITHUB_QUENTYSTUDIOS_TOKEN }}

tools/nevermore-cli/templates/game-template/.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ jobs:
4949
if: steps.check.outputs.enabled == 'true'
5050
run: |
5151
if [[ -n "$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" ]]; then
52-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
53-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
52+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
53+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
5454
fi
5555
5656
if [[ -n "$NPM_TOKEN" ]]; then
57-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
58-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
57+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
58+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
5959
fi
6060
env:
6161
NPM_GITHUB_QUENTYSTUDIOS_TOKEN: $\{{ secrets.NPM_GITHUB_QUENTYSTUDIOS_TOKEN }}

tools/nevermore-cli/templates/plugin-template/.github/workflows/integration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ jobs:
5555
if: steps.check.outputs.enabled == 'true'
5656
run: |
5757
if [[ -n "$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" ]]; then
58-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
59-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
58+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
59+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
6060
fi
6161
6262
if [[ -n "$NPM_TOKEN" ]]; then
63-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
64-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
63+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
64+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
6565
fi
6666
env:
6767
NPM_GITHUB_QUENTYSTUDIOS_TOKEN: $\{{ secrets.NPM_GITHUB_QUENTYSTUDIOS_TOKEN }}

tools/nevermore-cli/templates/plugin-template/.github/workflows/linting.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
- name: Setup npm for GitHub Packages
2828
run: |
2929
if [[ -n "$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" ]]; then
30-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
31-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
30+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
31+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
3232
fi
3333
3434
if [[ -n "$NPM_TOKEN" ]]; then
35-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
36-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
35+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
36+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
3737
fi
3838
env:
3939
NPM_GITHUB_QUENTYSTUDIOS_TOKEN: $\{{ secrets.NPM_GITHUB_QUENTYSTUDIOS_TOKEN }}

tools/nevermore-cli/templates/plugin-template/.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jobs:
5353
if: steps.check.outputs.enabled == 'true'
5454
run: |
5555
if [[ -n "$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" ]]; then
56-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
57-
echo "//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
56+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> .npmrc
57+
echo -e "\n//npm.pkg.github.com/:_authToken=$NPM_GITHUB_QUENTYSTUDIOS_TOKEN" >> ~/.npmrc
5858
fi
5959
6060
if [[ -n "$NPM_TOKEN" ]]; then
61-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
62-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
61+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
62+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
6363
fi
6464
env:
6565
NPM_GITHUB_QUENTYSTUDIOS_TOKEN: $\{{ secrets.NPM_GITHUB_QUENTYSTUDIOS_TOKEN }}

0 commit comments

Comments
 (0)