@smoothbricks/cli 0.10.5 โ 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/github-ci/index.d.ts.map +1 -1
- package/dist/github-ci/index.js +5 -3
- package/dist/lib/json.d.ts +2 -0
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/json.js +2 -2
- package/dist/monorepo/ci-workflow.d.ts +2 -0
- package/dist/monorepo/ci-workflow.d.ts.map +1 -1
- package/dist/monorepo/ci-workflow.js +10 -4
- package/dist/monorepo/github-runs-on.d.ts +14 -0
- package/dist/monorepo/github-runs-on.d.ts.map +1 -0
- package/dist/monorepo/github-runs-on.js +43 -0
- package/dist/monorepo/index.d.ts +2 -2
- package/dist/monorepo/index.d.ts.map +1 -1
- package/dist/monorepo/index.js +7 -7
- package/dist/monorepo/managed-files.d.ts +30 -3
- package/dist/monorepo/managed-files.d.ts.map +1 -1
- package/dist/monorepo/managed-files.js +78 -63
- package/dist/monorepo/packs/index.js +1 -1
- package/dist/monorepo/publish-workflow.d.ts +3 -0
- package/dist/monorepo/publish-workflow.d.ts.map +1 -1
- package/dist/monorepo/publish-workflow.js +17 -14
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +24 -7
- package/managed/templates/github/actions/cache-nix-devenv/action.yml +13 -11
- package/managed/templates/github/actions/save-nix-devenv/action.yml +34 -3
- package/managed/templates/github/actions/setup-devenv/action.yml +44 -15
- package/managed/templates/github/workflows/managed-files.yml +64 -12
- package/package.json +1 -1
- package/src/cli.ts +2 -2
- package/src/github-ci/index.test.ts +3 -3
- package/src/github-ci/index.ts +6 -3
- package/src/lib/json.ts +2 -0
- package/src/monorepo/__tests__/ci-workflow.test.ts +37 -1
- package/src/monorepo/__tests__/publish-workflow.test.ts +28 -1
- package/src/monorepo/ci-workflow.ts +14 -4
- package/src/monorepo/github-runs-on.ts +45 -0
- package/src/monorepo/index.ts +7 -7
- package/src/monorepo/managed-files.test.ts +49 -0
- package/src/monorepo/managed-files.ts +100 -64
- package/src/monorepo/packs/index.ts +1 -1
- package/src/monorepo/publish-workflow.ts +23 -15
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from '@smoothbricks/nx-plugin/workspace-config-policy';
|
|
8
8
|
import type { Options as PrettierOptions } from 'prettier';
|
|
9
9
|
import { isSmoothBricksCodebasePackageName } from '../lib/cli-package.js';
|
|
10
|
+
import { renderRunsOnLine, type WorkflowRunsOn } from './github-runs-on.js';
|
|
10
11
|
|
|
11
12
|
const PUBLISH_WORKFLOW_FORMAT_OPTIONS = Object.freeze({
|
|
12
13
|
parser: 'yaml',
|
|
@@ -55,6 +56,8 @@ export interface PublishWorkflowDefinitionOptions {
|
|
|
55
56
|
deployProvider?: 'cloudflare';
|
|
56
57
|
repoName?: string;
|
|
57
58
|
platformTargetGlobs?: readonly string[];
|
|
59
|
+
/** Linux jobs only. Default ubuntu-latest. Same smoo.github.runsOn as CI. */
|
|
60
|
+
runsOn?: WorkflowRunsOn;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export interface PublishWorkflowInputs {
|
|
@@ -441,7 +444,8 @@ function yamlLinesForStep(step: PublishWorkflowStep, options: PublishWorkflowDef
|
|
|
441
444
|
case PublishWorkflowStepKind.UploadTraceDbs:
|
|
442
445
|
return [
|
|
443
446
|
` - name: ${step.name}`,
|
|
444
|
-
|
|
447
|
+
' # Default is success(); failure() uploads traces only when the job already failed.',
|
|
448
|
+
' if: failure()',
|
|
445
449
|
' uses: actions/upload-artifact@v7.0.1',
|
|
446
450
|
' with:',
|
|
447
451
|
` name: trace-results-${githubExpression('github.run_id')}`,
|
|
@@ -465,7 +469,8 @@ function yamlLinesForStep(step: PublishWorkflowStep, options: PublishWorkflowDef
|
|
|
465
469
|
case PublishWorkflowStepKind.SaveNixDevenv:
|
|
466
470
|
return [
|
|
467
471
|
` - name: ${step.name}`,
|
|
468
|
-
|
|
472
|
+
' # success() is default; always() still saves GH Nix cache after a red job.',
|
|
473
|
+
' if: always()',
|
|
469
474
|
' uses: ./.github/actions/save-nix-devenv',
|
|
470
475
|
' with:',
|
|
471
476
|
` nix-cache-hit: ${githubExpression('steps.setup.outputs.nix-cache-hit')}`,
|
|
@@ -498,7 +503,7 @@ function deployEnvLines(options: PublishWorkflowDefinitionOptions): string[] {
|
|
|
498
503
|
|
|
499
504
|
function conditionalRunStep(step: PublishWorkflowStep, run: string): string[] {
|
|
500
505
|
const condition = "steps.version.outputs.mode != 'none'";
|
|
501
|
-
return [` - name: ${step.name}`, ` if: ${
|
|
506
|
+
return [` - name: ${step.name}`, ` if: ${condition}`, ` run: ${run}`];
|
|
502
507
|
}
|
|
503
508
|
|
|
504
509
|
function renderSingleJobPublishWorkflowSteps(
|
|
@@ -514,7 +519,7 @@ function renderSingleJobPublishWorkflowSteps(
|
|
|
514
519
|
if (step.kind === PublishWorkflowStepKind.Build) {
|
|
515
520
|
lines.push(
|
|
516
521
|
' - name: ๐ง Build supplemental Linux targets',
|
|
517
|
-
|
|
522
|
+
" if: steps.version.outputs.mode != 'none'",
|
|
518
523
|
` run: smoo github-ci nx-run-many --targets "${LINUX_PLATFORM_TARGET_GLOBS.join(',')}" --projects "${githubExpression(
|
|
519
524
|
'steps.version.outputs.projects',
|
|
520
525
|
)}"`,
|
|
@@ -566,7 +571,7 @@ defaults:
|
|
|
566
571
|
|
|
567
572
|
jobs:
|
|
568
573
|
linux-release-candidate:
|
|
569
|
-
|
|
574
|
+
${renderRunsOnLine(options.runsOn)}
|
|
570
575
|
permissions:
|
|
571
576
|
contents: write
|
|
572
577
|
id-token: none
|
|
@@ -642,7 +647,7 @@ function renderLinuxReleaseCandidateSteps(
|
|
|
642
647
|
} else if (step.kind === PublishWorkflowStepKind.Build) {
|
|
643
648
|
lines.push(
|
|
644
649
|
` - name: ${step.name}`,
|
|
645
|
-
|
|
650
|
+
" if: steps.version.outputs.mode != 'none'",
|
|
646
651
|
' run:',
|
|
647
652
|
` smoo github-ci nx-run-many --targets build --projects "${githubExpression(
|
|
648
653
|
'steps.version.outputs.projects',
|
|
@@ -667,7 +672,7 @@ function renderLinuxReleaseCandidateSteps(
|
|
|
667
672
|
'',
|
|
668
673
|
` # Step ${stepNumber}`,
|
|
669
674
|
' - name: ๐ง Build supplemental Linux targets',
|
|
670
|
-
|
|
675
|
+
" if: steps.version.outputs.mode != 'none'",
|
|
671
676
|
' run:',
|
|
672
677
|
` smoo github-ci nx-run-many --targets "${LINUX_PLATFORM_TARGET_GLOBS.join(
|
|
673
678
|
',',
|
|
@@ -700,7 +705,7 @@ function renderLinuxReleaseCandidateSteps(
|
|
|
700
705
|
'',
|
|
701
706
|
` # Step ${stepNumber++}`,
|
|
702
707
|
' - name: ๐ค Upload validated build outputs',
|
|
703
|
-
|
|
708
|
+
" if: steps.version.outputs.mode != 'none'",
|
|
704
709
|
' uses: actions/upload-artifact@v7.0.1',
|
|
705
710
|
' with:',
|
|
706
711
|
` name: publish-release-outputs-${githubExpression('github.run_id')}`,
|
|
@@ -714,7 +719,7 @@ function renderLinuxReleaseCandidateSteps(
|
|
|
714
719
|
'',
|
|
715
720
|
` # Step ${stepNumber++}`,
|
|
716
721
|
' - name: ๐ค Upload supplemental Linux outputs',
|
|
717
|
-
|
|
722
|
+
" if: steps.version.outputs.mode != 'none'",
|
|
718
723
|
' uses: actions/upload-artifact@v7.0.1',
|
|
719
724
|
' with:',
|
|
720
725
|
` name: publish-linux-outputs-${githubExpression('github.run_id')}`,
|
|
@@ -730,7 +735,8 @@ function renderLinuxReleaseCandidateSteps(
|
|
|
730
735
|
'',
|
|
731
736
|
` # Step ${stepNumber}`,
|
|
732
737
|
' - name: ๐งน Cleanup and cache Nix/devenv',
|
|
733
|
-
|
|
738
|
+
' # success() is default; always() still saves GH Nix cache after a red job.',
|
|
739
|
+
' if: always()',
|
|
734
740
|
' uses: ./.github/actions/save-nix-devenv',
|
|
735
741
|
' with:',
|
|
736
742
|
` nix-cache-hit: ${githubExpression('steps.setup.outputs.nix-cache-hit')}`,
|
|
@@ -792,7 +798,8 @@ function renderMacosPlatformSteps(options: PublishWorkflowDefinitionOptions): st
|
|
|
792
798
|
'',
|
|
793
799
|
` # Step ${stepNumber}`,
|
|
794
800
|
' - name: ๐งน Cleanup and cache Nix/devenv',
|
|
795
|
-
|
|
801
|
+
' # success() is default; always() still saves GH Nix cache after a red job.',
|
|
802
|
+
' if: always()',
|
|
796
803
|
' uses: ./.github/actions/save-nix-devenv',
|
|
797
804
|
' with:',
|
|
798
805
|
` nix-cache-hit: ${githubExpression('steps.setup.outputs.nix-cache-hit')}`,
|
|
@@ -876,7 +883,7 @@ function renderFinalLinuxPublishSteps(options: PublishWorkflowDefinitionOptions)
|
|
|
876
883
|
'',
|
|
877
884
|
` # Step ${stepNumber++}`,
|
|
878
885
|
' - name: ๐ฆ Apply verified Linux outputs',
|
|
879
|
-
` if: ${
|
|
886
|
+
` if: ${mode} != 'none'`,
|
|
880
887
|
' run:',
|
|
881
888
|
` smoo github-ci apply-outputs --source-sha "${githubExpression(
|
|
882
889
|
'needs.linux-release-candidate.outputs.release-sha',
|
|
@@ -896,7 +903,7 @@ function renderFinalLinuxPublishSteps(options: PublishWorkflowDefinitionOptions)
|
|
|
896
903
|
'',
|
|
897
904
|
` # Step ${stepNumber++}`,
|
|
898
905
|
' - name: ๐ Apply verified macOS outputs',
|
|
899
|
-
` if: ${
|
|
906
|
+
` if: ${mode} != 'none'`,
|
|
900
907
|
' run:',
|
|
901
908
|
` smoo github-ci apply-outputs --source-sha "${githubExpression('github.sha')}"`,
|
|
902
909
|
` "${githubExpression('runner.temp')}/publish-artifacts/publish-macos-outputs-${githubExpression(
|
|
@@ -905,7 +912,7 @@ function renderFinalLinuxPublishSteps(options: PublishWorkflowDefinitionOptions)
|
|
|
905
912
|
'',
|
|
906
913
|
` # Step ${stepNumber++}`,
|
|
907
914
|
` - name: โ
Validate restored release (${githubExpression(mode)})`,
|
|
908
|
-
` if: ${
|
|
915
|
+
` if: ${mode} != 'none'`,
|
|
909
916
|
' run: smoo monorepo validate',
|
|
910
917
|
'',
|
|
911
918
|
' # --- Release ------------------------------------------------------------',
|
|
@@ -937,7 +944,8 @@ function renderFinalLinuxPublishSteps(options: PublishWorkflowDefinitionOptions)
|
|
|
937
944
|
'',
|
|
938
945
|
` # Step ${stepNumber}`,
|
|
939
946
|
' - name: ๐งน Cleanup and cache Nix/devenv',
|
|
940
|
-
|
|
947
|
+
' # success() is default; always() still saves GH Nix cache after a red job.',
|
|
948
|
+
' if: always()',
|
|
941
949
|
' uses: ./.github/actions/save-nix-devenv',
|
|
942
950
|
' with:',
|
|
943
951
|
` nix-cache-hit: ${githubExpression('steps.setup.outputs.nix-cache-hit')}`,
|