pipecraft 0.0.0-releaseit → 0.26.0

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.
Files changed (183) hide show
  1. package/README.md +126 -108
  2. package/dist/cli/index.d.ts +69 -0
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +94 -22
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/generators/init.tpl.d.ts +70 -0
  7. package/dist/generators/init.tpl.d.ts.map +1 -1
  8. package/dist/generators/init.tpl.js +100 -8
  9. package/dist/generators/init.tpl.js.map +1 -1
  10. package/dist/generators/workflows.tpl.d.ts +86 -0
  11. package/dist/generators/workflows.tpl.d.ts.map +1 -1
  12. package/dist/generators/workflows.tpl.js +101 -9
  13. package/dist/generators/workflows.tpl.js.map +1 -1
  14. package/dist/templates/actions/calculate-version.yml.tpl.d.ts +47 -0
  15. package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -1
  16. package/dist/templates/actions/calculate-version.yml.tpl.js +72 -3
  17. package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -1
  18. package/dist/templates/actions/create-pr.yml.tpl.d.ts +14 -0
  19. package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -1
  20. package/dist/templates/actions/create-pr.yml.tpl.js +22 -2
  21. package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -1
  22. package/dist/templates/actions/create-release.yml.tpl.d.ts +18 -0
  23. package/dist/templates/actions/create-release.yml.tpl.d.ts.map +1 -0
  24. package/dist/templates/actions/create-release.yml.tpl.js +141 -0
  25. package/dist/templates/actions/create-release.yml.tpl.js.map +1 -0
  26. package/dist/templates/actions/create-tag.yml.tpl.d.ts +14 -0
  27. package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -1
  28. package/dist/templates/actions/create-tag.yml.tpl.js +22 -2
  29. package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
  30. package/dist/templates/actions/detect-changes.yml.tpl.d.ts +70 -0
  31. package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
  32. package/dist/templates/actions/detect-changes.yml.tpl.js +98 -2
  33. package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -1
  34. package/dist/templates/actions/manage-branch.yml.tpl.d.ts +14 -0
  35. package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -1
  36. package/dist/templates/actions/manage-branch.yml.tpl.js +22 -2
  37. package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -1
  38. package/dist/templates/actions/promote-branch.yml.tpl.d.ts +14 -0
  39. package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -1
  40. package/dist/templates/actions/promote-branch.yml.tpl.js +50 -7
  41. package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
  42. package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts +114 -1
  43. package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts.map +1 -1
  44. package/dist/templates/workflows/pipeline-path-based.yml.tpl.js +479 -74
  45. package/dist/templates/workflows/pipeline-path-based.yml.tpl.js.map +1 -1
  46. package/dist/types/index.d.ts +231 -8
  47. package/dist/types/index.d.ts.map +1 -1
  48. package/dist/types/index.js +9 -0
  49. package/dist/types/index.js.map +1 -1
  50. package/dist/utils/ast-path-operations.d.ts.map +1 -1
  51. package/dist/utils/ast-path-operations.js +24 -11
  52. package/dist/utils/ast-path-operations.js.map +1 -1
  53. package/dist/utils/config.d.ts +63 -0
  54. package/dist/utils/config.d.ts.map +1 -1
  55. package/dist/utils/config.js +71 -0
  56. package/dist/utils/config.js.map +1 -1
  57. package/dist/utils/github-setup.d.ts +323 -2
  58. package/dist/utils/github-setup.d.ts.map +1 -1
  59. package/dist/utils/github-setup.js +551 -23
  60. package/dist/utils/github-setup.js.map +1 -1
  61. package/dist/utils/idempotency.d.ts +147 -7
  62. package/dist/utils/idempotency.d.ts.map +1 -1
  63. package/dist/utils/idempotency.js +143 -15
  64. package/dist/utils/idempotency.js.map +1 -1
  65. package/dist/utils/logger.d.ts +134 -0
  66. package/dist/utils/logger.d.ts.map +1 -0
  67. package/dist/utils/logger.js +153 -0
  68. package/dist/utils/logger.js.map +1 -0
  69. package/dist/utils/preflight.d.ts +223 -12
  70. package/dist/utils/preflight.d.ts.map +1 -1
  71. package/dist/utils/preflight.js +216 -16
  72. package/dist/utils/preflight.js.map +1 -1
  73. package/dist/utils/versioning.d.ts +160 -8
  74. package/dist/utils/versioning.d.ts.map +1 -1
  75. package/dist/utils/versioning.js +179 -15
  76. package/dist/utils/versioning.js.map +1 -1
  77. package/package.json +26 -5
  78. package/.claude/settings.local.json +0 -35
  79. package/.github/actions/calculate-version/action.yml +0 -106
  80. package/.github/actions/create-pr/action.yml +0 -122
  81. package/.github/actions/create-release/action.yml +0 -74
  82. package/.github/actions/create-tag/action.yml +0 -94
  83. package/.github/actions/detect-changes/action.yml +0 -62
  84. package/.github/actions/manage-branch/action.yml +0 -113
  85. package/.github/actions/promote-branch/action.yml +0 -352
  86. package/.github/example/workflows/job.analyze.code.yml +0 -26
  87. package/.github/example/workflows/job.analyze.docker.yml +0 -32
  88. package/.github/example/workflows/job.app.api.deploy.yml +0 -127
  89. package/.github/example/workflows/job.app.api.test.yml +0 -102
  90. package/.github/example/workflows/job.app.docs.deploy.yml +0 -40
  91. package/.github/example/workflows/job.app.docs.test.yml +0 -50
  92. package/.github/example/workflows/job.app.web.deploy.yml +0 -96
  93. package/.github/example/workflows/job.app.web.test.yml +0 -49
  94. package/.github/example/workflows/job.changes.yml +0 -82
  95. package/.github/example/workflows/job.create-pr.yml +0 -96
  96. package/.github/example/workflows/job.env-check.yml +0 -43
  97. package/.github/example/workflows/job.fast-forward.yml +0 -103
  98. package/.github/example/workflows/job.lint.yml +0 -64
  99. package/.github/example/workflows/job.pr-name.yml +0 -70
  100. package/.github/example/workflows/job.pr-squash-name.yml +0 -27
  101. package/.github/example/workflows/job.tag.yml +0 -38
  102. package/.github/example/workflows/job.version.yml +0 -99
  103. package/.github/example/workflows/lib.plugin-base.publish.yml +0 -59
  104. package/.github/example/workflows/pipe.yml +0 -178
  105. package/.github/example/workflows/scripts/fastforward.sh +0 -51
  106. package/.github/example/workflows/scripts/pipe-cleaner.sh +0 -70
  107. package/.github/scripts/fastforward.sh +0 -51
  108. package/.github/scripts/pipe-cleaner.sh +0 -70
  109. package/.github/workflows/pipeline.yml +0 -220
  110. package/.github/workflows/pr-title-check.yml +0 -70
  111. package/.github/workflows/publish.yml +0 -39
  112. package/.pipecraftrc.json +0 -78
  113. package/.release-it.cjs +0 -71
  114. package/PIPELINE_TESTING_PLAN.md +0 -499
  115. package/TRUNK_FLOW_PLAN.md +0 -401
  116. package/assets/logo_banner.png +0 -0
  117. package/assets/logo_banner.webp +0 -0
  118. package/docs/USER_JOURNEY_ERRORS.md +0 -352
  119. package/eslint.config.js +0 -77
  120. package/examples/basic-config.json +0 -41
  121. package/examples/monorepo-config.json +0 -49
  122. package/examples/usage.md +0 -289
  123. package/scripts/debug-workflows.sh +0 -339
  124. package/scripts/parse-pipeline.js +0 -29
  125. package/scripts/test-job-order.cjs +0 -140
  126. package/scripts/validate-pipeline.cjs +0 -379
  127. package/scripts/verify-job-order.sh +0 -30
  128. package/src/cli/index.ts +0 -414
  129. package/src/generators/init.tpl.ts +0 -126
  130. package/src/generators/workflows.tpl.ts +0 -80
  131. package/src/templates/actions/calculate-version.yml.tpl.ts +0 -124
  132. package/src/templates/actions/create-pr.yml.tpl.ts +0 -147
  133. package/src/templates/actions/create-tag.yml.tpl.ts +0 -112
  134. package/src/templates/actions/detect-changes.yml.tpl.ts +0 -87
  135. package/src/templates/actions/manage-branch.yml.tpl.ts +0 -132
  136. package/src/templates/actions/promote-branch.yml.tpl.ts +0 -364
  137. package/src/templates/workflows/pipeline-path-based.yml.tpl.ts +0 -706
  138. package/src/types/index.ts +0 -64
  139. package/src/utils/README-ast-path-operations.md +0 -390
  140. package/src/utils/ast-path-operations.ts +0 -581
  141. package/src/utils/config.ts +0 -64
  142. package/src/utils/github-setup.ts +0 -558
  143. package/src/utils/idempotency.ts +0 -215
  144. package/src/utils/preflight.ts +0 -306
  145. package/src/utils/versioning.ts +0 -244
  146. package/tests/README.md +0 -229
  147. package/tests/TEST_STRUCTURE.md +0 -256
  148. package/tests/act/run-act-tests.sh +0 -345
  149. package/tests/debugging/debug-utils.ts +0 -538
  150. package/tests/debugging/debug-workflow.test.ts +0 -339
  151. package/tests/debugging/debug-workflows.sh +0 -339
  152. package/tests/debugging/iterative-debug.ts +0 -652
  153. package/tests/debugging/run-debug-tests.sh +0 -431
  154. package/tests/fixtures/basic-config.json +0 -51
  155. package/tests/fixtures/invalid-config.json +0 -9
  156. package/tests/fixtures/pipeline-generated.yml +0 -235
  157. package/tests/fixtures/pipeline-preserve-comments.yml +0 -245
  158. package/tests/fixtures/pipeline-user-modified.yml +0 -245
  159. package/tests/fixtures/test-config.json +0 -58
  160. package/tests/github-live/README.md +0 -250
  161. package/tests/github-local/JOB_WORKFLOW_TESTS.md +0 -296
  162. package/tests/github-local/README.md +0 -240
  163. package/tests/github-local/run-all-tests.sh +0 -422
  164. package/tests/github-local/test-job-workflows.sh +0 -631
  165. package/tests/github-local/test-pipeline-workflow.sh +0 -440
  166. package/tests/integration/generators.test.ts +0 -578
  167. package/tests/integration/path-based-template.test.ts +0 -510
  168. package/tests/integration/simple-path-based.test.ts +0 -415
  169. package/tests/setup.ts +0 -56
  170. package/tests/unit/ast-path-operations-extended.test.ts +0 -302
  171. package/tests/unit/cli.test.ts +0 -541
  172. package/tests/unit/config-extended.test.ts +0 -412
  173. package/tests/unit/config.test.ts +0 -152
  174. package/tests/unit/github-setup.test.ts +0 -189
  175. package/tests/unit/idempotency-isolated.test.ts +0 -297
  176. package/tests/unit/job-order.test.ts +0 -157
  177. package/tests/unit/pipeline-path-based.test.ts +0 -511
  178. package/tests/unit/validate-pipeline.test.ts +0 -384
  179. package/tests/unit/versioning-extended.test.ts +0 -279
  180. package/tests/unit/versioning.test.ts +0 -241
  181. package/tsconfig.debug.json +0 -17
  182. package/tsconfig.json +0 -28
  183. package/vitest.config.ts +0 -51
@@ -1,96 +0,0 @@
1
- name: "Create PR"
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- version:
7
- description: 'The new version to deploy'
8
- required: true
9
- type: string
10
- workflow_dispatch:
11
-
12
- jobs:
13
- create-pr:
14
- runs-on: ubuntu-latest
15
- if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
16
- steps:
17
- - name: Checkout Code
18
- uses: actions/checkout@v4
19
- with:
20
- fetch-depth: 0 # Ensures full history for version tracking
21
-
22
- - name: Set Up Git
23
- run: |
24
- git config user.name "github-actions[bot]"
25
- git config user.email "github-actions[bot]@users.noreply.github.com"
26
-
27
- - name: Determine Base and Target Version
28
- id: versioning
29
- run: |
30
- set -x
31
- BASE_BRANCH=${{ github.ref_name == 'develop' && 'test' || 'main' }}
32
-
33
- # Fetch latest tag on base branch
34
- # Get the current commit hash on the base branch (test or main)
35
- BASE_COMMIT_HASH=$(git rev-parse origin/$BASE_BRANCH)
36
-
37
- # Get the tags that are on or before the base commit
38
- PREV_VERSION=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | while read tag; do git merge-base --is-ancestor "$tag" "$BASE_COMMIT_HASH" && echo "$tag" && break; done)
39
-
40
- if [[ -z "$PREV_VERSION" ]]; then
41
- echo "No previous version found, aborting."
42
- exit 1
43
- fi
44
-
45
- echo "Previous version: $PREV_VERSION"
46
- echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
47
- echo "PREV_VERSION=$PREV_VERSION" >> $GITHUB_ENV
48
-
49
- - name: Create Fake Branches
50
- run: |
51
- NEW_BRANCH="temp-${BASE_BRANCH}-${{ inputs.version }}"
52
- OLD_BRANCH="temp-${BASE_BRANCH}-${PREV_VERSION}"
53
-
54
- # Fetch the latest changes
55
- git fetch origin
56
-
57
- # Create a new fake branch from the current version of develop (or base branch)
58
- git checkout -b $NEW_BRANCH origin/${{ github.ref_name }}
59
- git push origin $NEW_BRANCH --force
60
-
61
- # Create an old branch based on the previous version on the base branch (test or main)
62
- git checkout -b $OLD_BRANCH origin/$BASE_BRANCH
63
- git push origin $OLD_BRANCH --force
64
-
65
- echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV
66
- echo "OLD_BRANCH=$OLD_BRANCH" >> $GITHUB_ENV
67
-
68
- - name: Create Pull Request
69
- uses: actions/github-script@v6
70
- with:
71
- script: |
72
- const base = process.env.OLD_BRANCH;
73
- const head = process.env.NEW_BRANCH;
74
- const version = '${{ inputs.version }}';
75
-
76
- const { data: existingPRs } = await github.rest.pulls.list({
77
- owner: context.repo.owner,
78
- repo: context.repo.repo,
79
- head: head,
80
- base: base,
81
- state: 'open'
82
- });
83
-
84
- if (existingPRs.length > 0) {
85
- console.log('A pull request already exists.');
86
- } else {
87
- const { data: pullRequest } = await github.rest.pulls.create({
88
- owner: context.repo.owner,
89
- repo: context.repo.repo,
90
- title: `ci: Promote ${process.env.BASE_BRANCH} from ${process.env.PREV_VERSION} to ${version}`,
91
- head: head,
92
- base: base,
93
- body: 'This PR is automatically created by CI.'
94
- });
95
- console.log(`Created pull request: ${pullRequest.html_url}`);
96
- }
@@ -1,43 +0,0 @@
1
- name: "Environment Check"
2
-
3
- on:
4
- workflow_call:
5
- outputs:
6
- project_id:
7
- description: "The determined project id"
8
- value: ${{ jobs.check.outputs.project_id }}
9
- bucket:
10
- description: "The determined bucket"
11
- value: ${{ jobs.check.outputs.bucket }}
12
-
13
- jobs:
14
- check:
15
- runs-on: ubuntu-latest
16
- if: ${{ github.ref_name == 'main' || github.ref_name == 'develop' || github.ref_name == 'test' }}
17
- outputs:
18
- project_id: ${{ steps.set-vars.outputs.project_id }}
19
- bucket: ${{ steps.set-vars.outputs.bucket }}
20
- steps:
21
- - name: Checkout
22
- uses: actions/checkout@v4
23
-
24
- - name: Set environment variables
25
- id: set-vars
26
- run: |
27
- echo "Current branch: ${{ github.ref_name }}"
28
- if [ "${{ github.ref_name }}" = "main" ]; then
29
- echo "Using PROD project ID"
30
- echo "project_id=${{ vars.PROJECT_ID_PROD }}" >> $GITHUB_OUTPUT
31
- echo "bucket=${{ vars.WEB_STORAGE_PROD }}" >> $GITHUB_OUTPUT
32
- elif [ "${{ github.ref_name }}" = "develop" ]; then
33
- echo "Using DEVELOP project ID"
34
- echo "project_id=${{ vars.PROJECT_ID_DEVELOP }}" >> $GITHUB_OUTPUT
35
- echo "bucket=${{ vars.WEB_STORAGE_DEVELOP }}" >> $GITHUB_OUTPUT
36
- elif [ "${{ github.ref_name }}" = "test" ]; then
37
- echo "Using TEST project ID"
38
- echo "project_id=${{ vars.PROJECT_ID_TEST }}" >> $GITHUB_OUTPUT
39
- echo "bucket=${{ vars.WEB_STORAGE_TEST }}" >> $GITHUB_OUTPUT
40
- else
41
- echo "Error: Unsupported branch ${{ github.ref_name }}"
42
- exit 1
43
- fi
@@ -1,103 +0,0 @@
1
- name: "Fast Forward After PR Merge"
2
-
3
- on:
4
- pull_request:
5
- types:
6
- - closed # Only run when PR is merged
7
-
8
- env:
9
- pipefile: 'pipe.yml'
10
-
11
- jobs:
12
- fast-forward:
13
- if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'temp-test') || startsWith(github.event.pull_request.head.ref, 'temp-main')
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: Verify PR Source is a Fake Branch
17
- id: verify-branch
18
- run: |
19
- PR_HEAD="${{ github.event.pull_request.head.ref }}"
20
- PR_BASE="${{ github.event.pull_request.base.ref }}"
21
-
22
-
23
- # Check if the PR source branch matches the fake branch pattern
24
- if [[ ! "$PR_HEAD" =~ ^temp-(test|main)-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25
- echo "Skipping: PR did not come from an auto-generated fake branch."
26
- exit 1
27
- fi
28
-
29
- # Extract version and base branch from the PR branch name
30
- BASE_BRANCH=$(echo "$PR_BASE" | cut -d'-' -f2)
31
- OLD_VERSION=$(echo "$PR_BASE" | cut -d'-' -f3-)
32
- NEXT_VERSION=$(echo "$PR_HEAD" | cut -d'-' -f3-)
33
-
34
- echo "BASE_BRANCH=$BASE_BRANCH"
35
- echo "OLD_VERSION=$OLD_VERSION"
36
- echo "NEXT_VERSION=$NEXT_VERSION"
37
-
38
- # Set as environment variables for later steps
39
- echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
40
- echo "OLD_VERSION=$OLD_VERSION" >> $GITHUB_ENV
41
- echo "NEXT_VERSION=$NEXT_VERSION" >> $GITHUB_ENV
42
-
43
- - name: Checkout Repository
44
- uses: actions/checkout@v4
45
- with:
46
- fetch-depth: 0 # Ensure full history for fast-forwarding
47
-
48
- - name: Set Up Git
49
- run: |
50
- git config user.name "github-actions[bot]"
51
- git config user.email "github-actions[bot]@users.noreply.github.com"
52
-
53
- - name: Get Latest Commit from Head Branch
54
- id: get-commit
55
- run: |
56
- PR_HEAD="${{ github.event.pull_request.head.ref }}"
57
- PR_BASE="${{ github.event.pull_request.base.ref }}"
58
-
59
- # Ensure the head branch is checked out
60
- git fetch origin $PR_HEAD:$PR_HEAD
61
- git checkout $PR_HEAD
62
-
63
- git rev-parse $PR_HEAD
64
-
65
- # Fetch the latest commit hash from the head branch
66
- COMMIT_HASH=$(git rev-parse $PR_HEAD)
67
-
68
- if [[ -z "$COMMIT_HASH" ]]; then
69
- echo "Failed to find commit for branch $PR_HEAD"
70
- exit 1
71
- fi
72
-
73
- echo "Found commit: $COMMIT_HASH"
74
- echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV
75
-
76
- - name: Fast Forward Target Branch
77
- run: |
78
- git fetch origin
79
-
80
- # Checkout the target branch (test or main)
81
- git checkout $BASE_BRANCH
82
-
83
- # Ensure fast-forward merge
84
- git merge --ff-only $COMMIT_HASH
85
-
86
- # Push the changes back to the target branch
87
- git push origin $BASE_BRANCH
88
-
89
- - name: Delete Temporary Branches
90
- run: |
91
- # Delete the fake branches after the merge
92
- git push origin --delete "temp-${BASE_BRANCH}-${OLD_VERSION}"
93
- git push origin --delete "temp-${BASE_BRANCH}-${NEXT_VERSION}"
94
-
95
- echo "Temporary branches deleted"
96
-
97
- - name: Trigger Test and Deploy Workflow
98
- run: |
99
- curl -X POST \
100
- -H "Accept: application/vnd.github.v3+json" \
101
- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
102
- https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{env.pipefile}}/dispatches \
103
- -d "{\"ref\":\"${BASE_BRANCH}\", \"inputs\": {\"migration_input\": \"false\", \"seed_input\": \"false\"}}"
@@ -1,64 +0,0 @@
1
- name: "Web: Lint & Test"
2
-
3
- on:
4
- workflow_call:
5
- workflow_dispatch:
6
-
7
- jobs:
8
- lint:
9
- name: ESLint
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Checkout repo
13
- uses: actions/checkout@v4
14
-
15
- - name: Setup node
16
- uses: actions/setup-node@v4
17
- with:
18
- node-version: 20
19
-
20
- - name: Install pnpm
21
- run: npm install -g pnpm
22
-
23
- - name: Cache dependencies
24
- uses: actions/cache@v4
25
- with:
26
- path: ~/.pnpm-store
27
- key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
28
- restore-keys: |
29
- ${{ runner.os }}-pnpm-
30
-
31
- - name: Install dependencies
32
- run: pnpm install --frozen-lockfile
33
-
34
- - name: Lint
35
- run: pnpm run lint:strict
36
-
37
- prettier:
38
- name: Prettier
39
- runs-on: ubuntu-latest
40
- steps:
41
- - name: Checkout repo
42
- uses: actions/checkout@v4
43
-
44
- - name: Setup node
45
- uses: actions/setup-node@v4
46
- with:
47
- node-version: 20
48
-
49
- - name: Install pnpm
50
- run: npm install -g pnpm
51
-
52
- - name: Cache dependencies
53
- uses: actions/cache@v4
54
- with:
55
- path: ~/.pnpm-store
56
- key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
57
- restore-keys: |
58
- ${{ runner.os }}-pnpm-
59
-
60
- - name: Install dependencies
61
- run: pnpm install --frozen-lockfile
62
-
63
- - name: Prettier check
64
- run: npm run format:check
@@ -1,70 +0,0 @@
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
@@ -1,27 +0,0 @@
1
- name: Enforce PR Title as Commit Message
2
-
3
- on:
4
- pull_request:
5
- types: [closed]
6
-
7
- jobs:
8
- enforce-squash-message:
9
- if: github.event.pull_request.merged == true && github.event.pull_request.merge_commit_sha != null
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Checkout code
13
- uses: actions/checkout@v4
14
-
15
- - name: Check squash commit message
16
- run: |
17
- TITLE="${{ github.event.pull_request.title }}"
18
- SHA="${{ github.event.pull_request.merge_commit_sha }}"
19
- MESSAGE=$(git log -1 --pretty=%B $SHA)
20
-
21
- echo "PR Title: $TITLE"
22
- echo "Squash Commit Message: $MESSAGE"
23
-
24
- if [[ "$MESSAGE" != "$TITLE" ]]; then
25
- echo "❌ Commit message does not match PR title!"
26
- exit 1
27
- fi
@@ -1,38 +0,0 @@
1
- name: "Tag"
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- version:
7
- description: 'The version to deploy'
8
- required: true
9
- type: string
10
- workflow_dispatch:
11
-
12
- jobs:
13
- tag:
14
- if: github.ref_name == 'develop'
15
- runs-on: ubuntu-latest
16
- steps:
17
-
18
- - name: Checkout Code
19
- uses: actions/checkout@v4
20
- with:
21
- fetch-depth: 0 # Ensures full history for rebase
22
-
23
- - name: Create Tag
24
- run: |
25
- git config --global user.name "github-actions[bot]"
26
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
27
-
28
- NEWEST_VERSION=${{ inputs.version }}
29
- LAST_TAG=$(git describe --tags --abbrev=0)
30
-
31
- if [ "$LAST_TAG" != "$NEWEST_VERSION" ]; then
32
- git tag $NEWEST_VERSION
33
- git push origin $NEWEST_VERSION
34
-
35
- echo "Creating new tag for version: ${LAST_TAG} -> ${NEWEST_VERSION}"
36
- else
37
- echo "Version already tagged. Skipping tag step."
38
- fi
@@ -1,99 +0,0 @@
1
- name: Versioning
2
-
3
- on:
4
- workflow_call:
5
- outputs:
6
- version:
7
- description: "The determined version"
8
- value: ${{ jobs.determine-version.outputs.version }}
9
-
10
- jobs:
11
-
12
- confirm-pass:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - name: Confirm pass
16
- run: exit 0
17
-
18
-
19
- determine-version:
20
- runs-on: ubuntu-latest
21
- if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/main' }}
22
- outputs:
23
- version: ${{ steps.set_version.outputs.version }}
24
- steps:
25
- - uses: actions/checkout@v4
26
- with:
27
- fetch-depth: 0
28
-
29
- - name: Install Node.js
30
- uses: actions/setup-node@v4
31
- with:
32
- node-version: 22
33
-
34
- - name: Configure Git
35
- run: |
36
- git config --global user.name "github-actions[bot]"
37
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
38
-
39
- - name: Get existing version tag
40
- id: get_version_old
41
- run: |
42
- set -x # Enable debugging output
43
- # Get the current commit hash
44
- git rev-parse HEAD
45
- COMMIT_HASH=$(git rev-parse HEAD)
46
- echo "Current commit hash: $COMMIT_HASH"
47
-
48
- # Check for tags on the current commit
49
- TAG=$(git tag --points-at $COMMIT_HASH | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)
50
- echo "Tags found: $TAG"
51
-
52
- if [ -z "$TAG" ]; then
53
- echo "No existing tag found on the current commit"
54
- else
55
- echo "Found existing tag: $TAG"
56
- echo "version=$TAG" >> $GITHUB_OUTPUT
57
- fi
58
-
59
- - name: Set up minimal package.json
60
- run: |
61
- echo '{
62
- "name": "temporary-lib",
63
- "version": "0.0.0-release-it"
64
- }' > package.json
65
-
66
- - name: Install dependencies
67
- run: npm install @release-it/conventional-changelog conventional-changelog-angular
68
-
69
- - name: Get version
70
- if:
71
- id: get_version_new
72
- run: |
73
- VERSION=$(npx release-it --ci --release-version 2>&1 || echo "")
74
- if [[ "$VERSION" == *"No new version to release"* || -z "$VERSION" ]]; then
75
- echo "No new version to release"
76
- echo "VERSION=" >> $GITHUB_ENV
77
- echo "version=" >> $GITHUB_OUTPUT
78
- else
79
- echo "New version to release: $VERSION"
80
- echo "VERSION=v$VERSION" >> $GITHUB_ENV
81
- echo "version=v$VERSION" >> $GITHUB_OUTPUT
82
- fi
83
-
84
- - name: Set version output
85
- id: set_version
86
- run: |
87
- if [ -n "${{ steps.get_version_old.outputs.version }}" ]; then
88
- echo "Using old version: ${{ steps.get_version_old.outputs.version }}"
89
- echo "version=${{ steps.get_version_old.outputs.version }}" >> $GITHUB_OUTPUT
90
- elif [ -n "${{ steps.get_version_new.outputs.version }}" ]; then
91
- echo "Using new version: ${{ steps.get_version_new.outputs.version }}"
92
- echo "version=${{ steps.get_version_new.outputs.version }}" >> $GITHUB_OUTPUT
93
- else
94
- echo "No version determined"
95
- echo "version=" >> $GITHUB_OUTPUT
96
- fi
97
-
98
- - name: Output version
99
- run: 'echo "Version determined: ${{ steps.set_version.outputs.version }}"'
@@ -1,59 +0,0 @@
1
- name: "PLUGIN:Base"
2
-
3
- on:
4
- push:
5
- paths:
6
- - 'libs/plugins/base-class/**' # the plugin folder
7
- - '.github/workflows/plugin.base**' # this file and any related workflows
8
- workflow_dispatch:
9
-
10
- jobs:
11
- build:
12
- name: "PLUGIN:Base:Publish to NPM"
13
- runs-on: ubuntu-latest
14
- env:
15
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
17
- steps:
18
- - uses: actions/checkout@v4
19
-
20
- - name: Setup pnpm
21
- uses: pnpm/action-setup@v4
22
- with:
23
- version: 9
24
-
25
- - name: Use Node.js
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: '18'
29
- registry-url: 'https://registry.npmjs.org'
30
- cache: 'pnpm'
31
-
32
- - name: Configure root NPM Authentication
33
- run: |
34
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
35
-
36
- - name: Install root dependencies
37
- run: |
38
- ls -la;
39
- pnpm install --frozen-lockfile
40
-
41
- - name: Get root version
42
- id: get_version
43
- run: |
44
- VERSION=$(npx release-it --ci --dry-run | grep "New version" | awk '{print $NF}')
45
- echo "VERSION=$VERSION" >> $GITHUB_ENV
46
-
47
- - name: Configure Plugin NPM Authentication
48
- run: |
49
- cd libs/plugins/base-class;
50
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
51
-
52
- - name: Install dependencies
53
- run: |
54
- pnpm install --frozen-lockfile -F madi-plg-base-class
55
-
56
- - name: Release
57
- run: |
58
- cd libs/plugins/base-class;
59
- npx release-it $VERSION --ci --dry-run;