pipecraft 0.0.0-releaseit
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/.claude/settings.local.json +35 -0
- package/.github/actions/calculate-version/action.yml +106 -0
- package/.github/actions/create-pr/action.yml +122 -0
- package/.github/actions/create-release/action.yml +74 -0
- package/.github/actions/create-tag/action.yml +94 -0
- package/.github/actions/detect-changes/action.yml +62 -0
- package/.github/actions/manage-branch/action.yml +113 -0
- package/.github/actions/promote-branch/action.yml +352 -0
- package/.github/example/workflows/job.analyze.code.yml +26 -0
- package/.github/example/workflows/job.analyze.docker.yml +32 -0
- package/.github/example/workflows/job.app.api.deploy.yml +127 -0
- package/.github/example/workflows/job.app.api.test.yml +102 -0
- package/.github/example/workflows/job.app.docs.deploy.yml +40 -0
- package/.github/example/workflows/job.app.docs.test.yml +50 -0
- package/.github/example/workflows/job.app.web.deploy.yml +96 -0
- package/.github/example/workflows/job.app.web.test.yml +49 -0
- package/.github/example/workflows/job.changes.yml +82 -0
- package/.github/example/workflows/job.create-pr.yml +96 -0
- package/.github/example/workflows/job.env-check.yml +43 -0
- package/.github/example/workflows/job.fast-forward.yml +103 -0
- package/.github/example/workflows/job.lint.yml +64 -0
- package/.github/example/workflows/job.pr-name.yml +70 -0
- package/.github/example/workflows/job.pr-squash-name.yml +27 -0
- package/.github/example/workflows/job.tag.yml +38 -0
- package/.github/example/workflows/job.version.yml +99 -0
- package/.github/example/workflows/lib.plugin-base.publish.yml +59 -0
- package/.github/example/workflows/pipe.yml +178 -0
- package/.github/example/workflows/scripts/fastforward.sh +51 -0
- package/.github/example/workflows/scripts/pipe-cleaner.sh +70 -0
- package/.github/scripts/fastforward.sh +51 -0
- package/.github/scripts/pipe-cleaner.sh +70 -0
- package/.github/workflows/pipeline.yml +220 -0
- package/.github/workflows/pr-title-check.yml +70 -0
- package/.github/workflows/publish.yml +39 -0
- package/.pipecraftrc.json +78 -0
- package/.release-it.cjs +71 -0
- package/PIPELINE_TESTING_PLAN.md +499 -0
- package/README.md +1101 -0
- package/TRUNK_FLOW_PLAN.md +401 -0
- package/assets/logo_banner.png +0 -0
- package/assets/logo_banner.webp +0 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +364 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/generators/init.tpl.d.ts +3 -0
- package/dist/generators/init.tpl.d.ts.map +1 -0
- package/dist/generators/init.tpl.js +117 -0
- package/dist/generators/init.tpl.js.map +1 -0
- package/dist/generators/workflows.tpl.d.ts +7 -0
- package/dist/generators/workflows.tpl.d.ts.map +1 -0
- package/dist/generators/workflows.tpl.js +73 -0
- package/dist/generators/workflows.tpl.js.map +1 -0
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/calculate-version.yml.tpl.js +122 -0
- package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -0
- package/dist/templates/actions/create-pr.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/create-pr.yml.tpl.js +145 -0
- package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -0
- package/dist/templates/actions/create-tag.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/create-tag.yml.tpl.js +111 -0
- package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -0
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/detect-changes.yml.tpl.js +79 -0
- package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -0
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/manage-branch.yml.tpl.js +130 -0
- package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -0
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts +3 -0
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -0
- package/dist/templates/actions/promote-branch.yml.tpl.js +362 -0
- package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts +16 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts.map +1 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.js +652 -0
- package/dist/templates/workflows/pipeline-path-based.yml.tpl.js.map +1 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/ast-path-operations.d.ts +287 -0
- package/dist/utils/ast-path-operations.d.ts.map +1 -0
- package/dist/utils/ast-path-operations.js +419 -0
- package/dist/utils/ast-path-operations.js.map +1 -0
- package/dist/utils/config.d.ts +3 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +49 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/github-setup.d.ts +74 -0
- package/dist/utils/github-setup.d.ts.map +1 -0
- package/dist/utils/github-setup.js +418 -0
- package/dist/utils/github-setup.js.map +1 -0
- package/dist/utils/idempotency.d.ts +47 -0
- package/dist/utils/idempotency.d.ts.map +1 -0
- package/dist/utils/idempotency.js +176 -0
- package/dist/utils/idempotency.js.map +1 -0
- package/dist/utils/preflight.d.ts +55 -0
- package/dist/utils/preflight.d.ts.map +1 -0
- package/dist/utils/preflight.js +261 -0
- package/dist/utils/preflight.js.map +1 -0
- package/dist/utils/versioning.d.ts +41 -0
- package/dist/utils/versioning.d.ts.map +1 -0
- package/dist/utils/versioning.js +219 -0
- package/dist/utils/versioning.js.map +1 -0
- package/docs/USER_JOURNEY_ERRORS.md +352 -0
- package/eslint.config.js +77 -0
- package/examples/basic-config.json +41 -0
- package/examples/monorepo-config.json +49 -0
- package/examples/usage.md +289 -0
- package/package.json +58 -0
- package/scripts/debug-workflows.sh +339 -0
- package/scripts/parse-pipeline.js +29 -0
- package/scripts/test-job-order.cjs +140 -0
- package/scripts/validate-pipeline.cjs +379 -0
- package/scripts/verify-job-order.sh +30 -0
- package/src/cli/index.ts +414 -0
- package/src/generators/init.tpl.ts +126 -0
- package/src/generators/workflows.tpl.ts +80 -0
- package/src/templates/actions/calculate-version.yml.tpl.ts +124 -0
- package/src/templates/actions/create-pr.yml.tpl.ts +147 -0
- package/src/templates/actions/create-tag.yml.tpl.ts +112 -0
- package/src/templates/actions/detect-changes.yml.tpl.ts +87 -0
- package/src/templates/actions/manage-branch.yml.tpl.ts +132 -0
- package/src/templates/actions/promote-branch.yml.tpl.ts +364 -0
- package/src/templates/workflows/pipeline-path-based.yml.tpl.ts +706 -0
- package/src/types/index.ts +64 -0
- package/src/utils/README-ast-path-operations.md +390 -0
- package/src/utils/ast-path-operations.ts +581 -0
- package/src/utils/config.ts +64 -0
- package/src/utils/github-setup.ts +558 -0
- package/src/utils/idempotency.ts +215 -0
- package/src/utils/preflight.ts +306 -0
- package/src/utils/versioning.ts +244 -0
- package/tests/README.md +229 -0
- package/tests/TEST_STRUCTURE.md +256 -0
- package/tests/act/run-act-tests.sh +345 -0
- package/tests/debugging/debug-utils.ts +538 -0
- package/tests/debugging/debug-workflow.test.ts +339 -0
- package/tests/debugging/debug-workflows.sh +339 -0
- package/tests/debugging/iterative-debug.ts +652 -0
- package/tests/debugging/run-debug-tests.sh +431 -0
- package/tests/fixtures/basic-config.json +51 -0
- package/tests/fixtures/invalid-config.json +9 -0
- package/tests/fixtures/pipeline-generated.yml +235 -0
- package/tests/fixtures/pipeline-preserve-comments.yml +245 -0
- package/tests/fixtures/pipeline-user-modified.yml +245 -0
- package/tests/fixtures/test-config.json +58 -0
- package/tests/github-live/README.md +250 -0
- package/tests/github-local/JOB_WORKFLOW_TESTS.md +296 -0
- package/tests/github-local/README.md +240 -0
- package/tests/github-local/run-all-tests.sh +422 -0
- package/tests/github-local/test-job-workflows.sh +631 -0
- package/tests/github-local/test-pipeline-workflow.sh +440 -0
- package/tests/integration/generators.test.ts +578 -0
- package/tests/integration/path-based-template.test.ts +510 -0
- package/tests/integration/simple-path-based.test.ts +415 -0
- package/tests/setup.ts +56 -0
- package/tests/unit/ast-path-operations-extended.test.ts +302 -0
- package/tests/unit/cli.test.ts +541 -0
- package/tests/unit/config-extended.test.ts +412 -0
- package/tests/unit/config.test.ts +152 -0
- package/tests/unit/github-setup.test.ts +189 -0
- package/tests/unit/idempotency-isolated.test.ts +297 -0
- package/tests/unit/job-order.test.ts +157 -0
- package/tests/unit/pipeline-path-based.test.ts +511 -0
- package/tests/unit/validate-pipeline.test.ts +384 -0
- package/tests/unit/versioning-extended.test.ts +279 -0
- package/tests/unit/versioning.test.ts +241 -0
- package/tsconfig.debug.json +17 -0
- package/tsconfig.json +28 -0
- package/vitest.config.ts +51 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
name: "Pipeline"
|
|
2
|
+
run-name: "${{ github.ref_name }} #${{ inputs.run_number || github.run_number }}${{ inputs.version && format(' - {0}', inputs.version) || '' }}"
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: The version to deploy
|
|
8
|
+
required: false
|
|
9
|
+
type: string
|
|
10
|
+
baseRef:
|
|
11
|
+
description: The base reference for comparison
|
|
12
|
+
required: false
|
|
13
|
+
type: string
|
|
14
|
+
run_number:
|
|
15
|
+
description: The original run number from develop branch
|
|
16
|
+
required: false
|
|
17
|
+
type: string
|
|
18
|
+
push:
|
|
19
|
+
branches:
|
|
20
|
+
- develop
|
|
21
|
+
- staging
|
|
22
|
+
- main
|
|
23
|
+
jobs:
|
|
24
|
+
|
|
25
|
+
#=============================================================================
|
|
26
|
+
# CHANGES DETECTION
|
|
27
|
+
#=============================================================================
|
|
28
|
+
changes:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: ./.github/actions/detect-changes
|
|
33
|
+
id: detect
|
|
34
|
+
with:
|
|
35
|
+
baseRef: ${{ inputs.baseRef || 'main' }}
|
|
36
|
+
outputs:
|
|
37
|
+
cicd: ${{ steps.detect.outputs.cicd }}
|
|
38
|
+
core: ${{ steps.detect.outputs.core }}
|
|
39
|
+
test: ${{ steps.detect.outputs.test }}
|
|
40
|
+
|
|
41
|
+
#=============================================================================
|
|
42
|
+
# TESTING JOBS
|
|
43
|
+
#=============================================================================
|
|
44
|
+
test-cicd:
|
|
45
|
+
needs: changes
|
|
46
|
+
if: ${{ needs.changes.outputs.cicd == 'true' }}
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
# TODO: Replace with your cicd test logic
|
|
50
|
+
- name: Run cicd tests
|
|
51
|
+
run: |
|
|
52
|
+
echo "Running tests for cicd domain"
|
|
53
|
+
echo "Replace this with your actual test commands"
|
|
54
|
+
# Example: npm test -- --testPathPattern=cicd
|
|
55
|
+
|
|
56
|
+
test-core:
|
|
57
|
+
needs: changes
|
|
58
|
+
if: ${{ needs.changes.outputs.core == 'true' }}
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
# TODO: Replace with your core test logic
|
|
62
|
+
- name: Run core tests
|
|
63
|
+
run: |
|
|
64
|
+
echo "Running tests for core domain"
|
|
65
|
+
echo "Replace this with your actual test commands"
|
|
66
|
+
# Example: npm test -- --testPathPattern=core
|
|
67
|
+
|
|
68
|
+
test-test:
|
|
69
|
+
needs: changes
|
|
70
|
+
if: ${{ needs.changes.outputs.test == 'true' }}
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
steps:
|
|
73
|
+
# TODO: Replace with your test test logic
|
|
74
|
+
- name: Run test tests
|
|
75
|
+
run: |
|
|
76
|
+
echo "Running tests for test domain"
|
|
77
|
+
echo "Replace this with your actual test commands"
|
|
78
|
+
# Example: npm test -- --testPathPattern=test
|
|
79
|
+
|
|
80
|
+
version:
|
|
81
|
+
if: ${{
|
|
82
|
+
always() && (
|
|
83
|
+
needs.test-cicd.result == 'success' ||
|
|
84
|
+
needs.test-core.result == 'success' ||
|
|
85
|
+
needs.test-test.result == 'success'
|
|
86
|
+
) &&
|
|
87
|
+
(
|
|
88
|
+
needs.test-cicd.result != 'failure' &&
|
|
89
|
+
needs.test-core.result != 'failure' &&
|
|
90
|
+
needs.test-test.result != 'failure'
|
|
91
|
+
)
|
|
92
|
+
}}
|
|
93
|
+
needs: [ changes, test-cicd, test-core, test-test ]
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
steps:
|
|
96
|
+
- uses: actions/checkout@v4
|
|
97
|
+
- uses: ./.github/actions/calculate-version
|
|
98
|
+
id: version
|
|
99
|
+
with:
|
|
100
|
+
baseRef: ${{ inputs.baseRef || 'main' }}
|
|
101
|
+
outputs:
|
|
102
|
+
version: ${{ steps.version.outputs.version }}
|
|
103
|
+
|
|
104
|
+
#=============================================================================
|
|
105
|
+
# DEPLOYMENT JOBS
|
|
106
|
+
#=============================================================================
|
|
107
|
+
deploy-core:
|
|
108
|
+
needs: [ changes, version ]
|
|
109
|
+
if: ${{ always() && needs.changes.outputs.core == 'true' && needs.version.result == 'success' }}
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
steps:
|
|
112
|
+
- name: Deploy core
|
|
113
|
+
run: |
|
|
114
|
+
echo "Deploying core"
|
|
115
|
+
echo "Replace this with your actual deploy commands"
|
|
116
|
+
# Example: npm deploy -- --testPathPattern=core
|
|
117
|
+
|
|
118
|
+
#=============================================================================
|
|
119
|
+
# REMOTE TESTING JOBS
|
|
120
|
+
#=============================================================================
|
|
121
|
+
remote-test-core:
|
|
122
|
+
needs: [ deploy-core, changes ]
|
|
123
|
+
if: ${{ always() && needs.deploy-core.result == 'success' && needs.changes.outputs.core == 'true' }}
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- name: Test core
|
|
127
|
+
run: |
|
|
128
|
+
echo "Testing core remotely"
|
|
129
|
+
echo "Replace this with your actual test commands"
|
|
130
|
+
# Example: npm test -- --testPathPattern=core
|
|
131
|
+
|
|
132
|
+
#=============================================================================
|
|
133
|
+
# TAG & PROMOTE
|
|
134
|
+
#=============================================================================
|
|
135
|
+
tag:
|
|
136
|
+
# Needs all deploy and/or remote test jobs to succeed or be skipped
|
|
137
|
+
# Needs at least one domain to succeed
|
|
138
|
+
needs: [ version, deploy-core, remote-test-core ]
|
|
139
|
+
if: ${{
|
|
140
|
+
always() &&
|
|
141
|
+
github.ref_name == 'develop' &&
|
|
142
|
+
needs.version.result == 'success' &&
|
|
143
|
+
(
|
|
144
|
+
needs.deploy-core.result != 'failure' &&
|
|
145
|
+
needs.remote-test-core.result != 'failure'
|
|
146
|
+
) &&
|
|
147
|
+
(
|
|
148
|
+
needs.deploy-core.result == 'success' ||
|
|
149
|
+
needs.remote-test-core.result == 'success'
|
|
150
|
+
)
|
|
151
|
+
}}
|
|
152
|
+
runs-on: ubuntu-latest
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/checkout@v4
|
|
155
|
+
- uses: ./.github/actions/create-tag
|
|
156
|
+
with:
|
|
157
|
+
version: ${{ needs.version.outputs.version }}
|
|
158
|
+
#=============================================================================
|
|
159
|
+
# PROMOTION JOB
|
|
160
|
+
#=============================================================================
|
|
161
|
+
promote:
|
|
162
|
+
# Only runs on push or manual workflow_dispatch events to branches that can promote
|
|
163
|
+
# Waits for version/tag if they run, but doesn't fail if they're skipped
|
|
164
|
+
# Needs all deploy and/or remote test jobs to succeed
|
|
165
|
+
if: ${{
|
|
166
|
+
always() &&
|
|
167
|
+
(
|
|
168
|
+
github.event_name == 'push' ||
|
|
169
|
+
github.event_name == 'workflow_dispatch'
|
|
170
|
+
) &&
|
|
171
|
+
(
|
|
172
|
+
needs.version.result == 'success' ||
|
|
173
|
+
needs.version.result == 'skipped'
|
|
174
|
+
) &&
|
|
175
|
+
(
|
|
176
|
+
needs.tag.result == 'success' ||
|
|
177
|
+
needs.tag.result == 'skipped'
|
|
178
|
+
) &&
|
|
179
|
+
(
|
|
180
|
+
github.ref_name == 'develop' ||
|
|
181
|
+
github.ref_name == 'staging'
|
|
182
|
+
)
|
|
183
|
+
}}
|
|
184
|
+
needs: [ version, tag ]
|
|
185
|
+
runs-on: ubuntu-latest
|
|
186
|
+
steps:
|
|
187
|
+
- uses: actions/checkout@v4
|
|
188
|
+
- uses: ./.github/actions/promote-branch
|
|
189
|
+
with:
|
|
190
|
+
sourceBranch: ${{ github.ref_name }}
|
|
191
|
+
version: ${{ needs.version.outputs.version }}
|
|
192
|
+
run_number: ${{ inputs.run_number || github.run_number }}
|
|
193
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
194
|
+
|
|
195
|
+
#=============================================================================
|
|
196
|
+
# RELEASE JOB (Main Branch Only)
|
|
197
|
+
#=============================================================================
|
|
198
|
+
release:
|
|
199
|
+
# Create GitHub release on main branch after successful tests and versioning
|
|
200
|
+
if: ${{
|
|
201
|
+
always() &&
|
|
202
|
+
github.ref_name == 'main' &&
|
|
203
|
+
(
|
|
204
|
+
github.event_name == 'push' ||
|
|
205
|
+
github.event_name == 'workflow_dispatch'
|
|
206
|
+
) &&
|
|
207
|
+
needs.version.result == 'success' &&
|
|
208
|
+
(
|
|
209
|
+
needs.tag.result == 'success' ||
|
|
210
|
+
needs.tag.result == 'skipped'
|
|
211
|
+
)
|
|
212
|
+
}}
|
|
213
|
+
needs: [ version, tag ]
|
|
214
|
+
runs-on: ubuntu-latest
|
|
215
|
+
steps:
|
|
216
|
+
- uses: actions/checkout@v4
|
|
217
|
+
- uses: ./.github/actions/create-release
|
|
218
|
+
with:
|
|
219
|
+
version: ${{ needs.version.outputs.version }}
|
|
220
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: "PR Title Format Check"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
- reopened
|
|
10
|
+
pull_request:
|
|
11
|
+
types:
|
|
12
|
+
- opened
|
|
13
|
+
- edited
|
|
14
|
+
- synchronize
|
|
15
|
+
- reopened
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
pull-requests: read
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
main:
|
|
22
|
+
name: Validate PR title
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: amannn/action-semantic-pull-request@v5
|
|
26
|
+
id: lint_pr_title
|
|
27
|
+
env:
|
|
28
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
+
with:
|
|
30
|
+
# Configure which types are allowed (newline-delimited).
|
|
31
|
+
# Default: https://github.com/commitizen/conventional-commit-types
|
|
32
|
+
types: |
|
|
33
|
+
fix
|
|
34
|
+
feat
|
|
35
|
+
docs
|
|
36
|
+
style
|
|
37
|
+
chore
|
|
38
|
+
refactor
|
|
39
|
+
perf
|
|
40
|
+
test
|
|
41
|
+
ci
|
|
42
|
+
build
|
|
43
|
+
revert
|
|
44
|
+
major
|
|
45
|
+
requireScope: false
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
- uses: marocchino/sticky-pull-request-comment@v2
|
|
49
|
+
# When the previous steps fails, the workflow would stop. By adding this
|
|
50
|
+
# condition you can continue the execution with the populated error message.
|
|
51
|
+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
|
|
52
|
+
with:
|
|
53
|
+
header: pr-title-lint-error
|
|
54
|
+
message: |
|
|
55
|
+
Hey there and thank you for opening this pull request! 👋🏼
|
|
56
|
+
|
|
57
|
+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
|
|
58
|
+
|
|
59
|
+
Details:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
${{ steps.lint_pr_title.outputs.error_message }}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
# Delete a previous comment when the issue has been resolved
|
|
66
|
+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
|
|
67
|
+
uses: marocchino/sticky-pull-request-comment@v2
|
|
68
|
+
with:
|
|
69
|
+
header: pr-title-lint-error
|
|
70
|
+
delete: true
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
tag:
|
|
9
|
+
description: 'Release tag to publish (e.g., v1.2.3)'
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
id-token: write # Required for OIDC
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
publish:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
ref: ${{ github.event.release.tag_name || inputs.tag }}
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 22
|
|
28
|
+
registry-url: 'https://registry.npmjs.org'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Build package
|
|
34
|
+
run: npm run build
|
|
35
|
+
|
|
36
|
+
- name: Publish to npm
|
|
37
|
+
run: npm publish --provenance --access public
|
|
38
|
+
env:
|
|
39
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ciProvider": "github",
|
|
3
|
+
"mergeStrategy": "fast-forward",
|
|
4
|
+
"requireConventionalCommits": true,
|
|
5
|
+
"initialBranch": "develop",
|
|
6
|
+
"finalBranch": "main",
|
|
7
|
+
"branchFlow": [
|
|
8
|
+
"develop",
|
|
9
|
+
"staging",
|
|
10
|
+
"main"
|
|
11
|
+
],
|
|
12
|
+
"autoMerge": {
|
|
13
|
+
"staging": true,
|
|
14
|
+
"main": true
|
|
15
|
+
},
|
|
16
|
+
"semver": {
|
|
17
|
+
"bumpRules": {
|
|
18
|
+
"feat": "minor",
|
|
19
|
+
"fix": "patch",
|
|
20
|
+
"breaking": "major"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"actions": {
|
|
24
|
+
"onDevelopMerge": [
|
|
25
|
+
"runTests",
|
|
26
|
+
"fastForwardToStaging"
|
|
27
|
+
],
|
|
28
|
+
"onStagingMerge": [
|
|
29
|
+
"runTests",
|
|
30
|
+
"calculateVersion",
|
|
31
|
+
"createOrFastForwardToMain"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"domains": {
|
|
35
|
+
"core": {
|
|
36
|
+
"paths": [
|
|
37
|
+
"src/**"
|
|
38
|
+
],
|
|
39
|
+
"test": true,
|
|
40
|
+
"deploy": true,
|
|
41
|
+
"remoteTest": true,
|
|
42
|
+
"description": "PipeCraft core changes"
|
|
43
|
+
},
|
|
44
|
+
"test": {
|
|
45
|
+
"paths": [
|
|
46
|
+
"tests/**"
|
|
47
|
+
],
|
|
48
|
+
"test": true,
|
|
49
|
+
"description": "PipeCraft test changes"
|
|
50
|
+
},
|
|
51
|
+
"cicd": {
|
|
52
|
+
"paths": [
|
|
53
|
+
".github/**"
|
|
54
|
+
],
|
|
55
|
+
"test": true,
|
|
56
|
+
"description": "PipeCraft CI/CD changes"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"versioning": {
|
|
60
|
+
"enabled": true,
|
|
61
|
+
"releaseItConfig": ".release-it.cjs",
|
|
62
|
+
"conventionalCommits": true,
|
|
63
|
+
"autoTag": true,
|
|
64
|
+
"autoPush": false,
|
|
65
|
+
"changelog": true,
|
|
66
|
+
"bumpRules": {
|
|
67
|
+
"feat": "minor",
|
|
68
|
+
"fix": "patch",
|
|
69
|
+
"breaking": "major"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"rebuild": {
|
|
73
|
+
"enabled": true,
|
|
74
|
+
"skipIfUnchanged": true,
|
|
75
|
+
"forceRegenerate": false,
|
|
76
|
+
"cacheFile": ".pipecraft-cache.json"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/.release-it.cjs
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"git": {
|
|
3
|
+
"requireCleanWorkingDir": false,
|
|
4
|
+
"commit": false,
|
|
5
|
+
"pushArgs": ["--tags"],
|
|
6
|
+
"tagMatch": "v[0-9]*.[0-9]*.[0-9]*" // Required to exclude non-versioning tags
|
|
7
|
+
},
|
|
8
|
+
"github": {
|
|
9
|
+
"release": true,
|
|
10
|
+
"releaseName": "Release ${version}"
|
|
11
|
+
},
|
|
12
|
+
"npm": {
|
|
13
|
+
"ignoreVersion": true,
|
|
14
|
+
"publish": false,
|
|
15
|
+
"skipChecks": true
|
|
16
|
+
},
|
|
17
|
+
"hooks": {
|
|
18
|
+
"after:release": "echo ${version} > .release-version"
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
"plugins": {
|
|
23
|
+
"@release-it/conventional-changelog": {
|
|
24
|
+
"whatBump": (commits,options)=>{
|
|
25
|
+
let defaults = {
|
|
26
|
+
test: 'ignore',
|
|
27
|
+
build: 'ignore',
|
|
28
|
+
|
|
29
|
+
ci: 'patch',
|
|
30
|
+
docs: 'patch',
|
|
31
|
+
chore: 'minor',
|
|
32
|
+
style: 'patch',
|
|
33
|
+
fix: 'patch',
|
|
34
|
+
perf: 'patch',
|
|
35
|
+
refactor: 'patch',
|
|
36
|
+
|
|
37
|
+
feat: 'minor',
|
|
38
|
+
major: 'major',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let types = (options?.preset?.types || [])
|
|
42
|
+
.reduce((a, v) => {
|
|
43
|
+
return { ...a, [v.type]: v.release}
|
|
44
|
+
}, {})
|
|
45
|
+
|
|
46
|
+
types = Object.assign({},defaults,types)
|
|
47
|
+
let breakings = 0
|
|
48
|
+
let features = 0
|
|
49
|
+
let levelSet = ['major','minor','patch','ignore']
|
|
50
|
+
let level = Math.min.apply(Math, commits.map(commit => {
|
|
51
|
+
let level = levelSet.indexOf(types[commit.type])
|
|
52
|
+
level = level<0?3:level
|
|
53
|
+
if (commit.notes.length > 0) {
|
|
54
|
+
breakings += commit.notes.length
|
|
55
|
+
}
|
|
56
|
+
if(commit.type === 'feat'){
|
|
57
|
+
features += 1;
|
|
58
|
+
}
|
|
59
|
+
return level
|
|
60
|
+
}))
|
|
61
|
+
return {
|
|
62
|
+
level: level,
|
|
63
|
+
reason: breakings === 1
|
|
64
|
+
? `There is ${breakings} BREAKING CHANGE and ${features} features`
|
|
65
|
+
: `There are ${breakings} BREAKING CHANGES and ${features} features`
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|