simple-ts-sum 1.0.2 โ 1.0.3
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/README.md +27 -249
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,270 +1,48 @@
|
|
|
1
|
-
CI/CD Pipeline
|
|
1
|
+
# Tether - CI/CD Pipeline Implementation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
This repository implements a fully automated CI/CD pipeline for a TypeScript package following semantic release practices. The pipeline uses GitHub Actions and is designed with reusable workflows.
|
|
3
|
+
A TypeScript project demonstrating a fully automated CI/CD pipeline with reusable GitHub Actions workflows, semantic release practices, and branch protection rules.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
Available Labels
|
|
8
|
-
Label Purpose Trigger
|
|
9
|
-
verify Triggers integration/E2E tests When added to a PR
|
|
10
|
-
publish Triggers release candidate generation and publishing When added to a PR
|
|
11
|
-
How Labels Work
|
|
12
|
-
Default PR Checks: Every PR automatically runs:
|
|
5
|
+
## ๐ Quick Start
|
|
13
6
|
|
|
14
|
-
|
|
7
|
+
### Development
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
npm install
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
npm run build
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
npm test
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
## ๐ Features
|
|
16
|
+
โ
Fully automated CI/CD pipeline using GitHub Actions
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
# Additional checks triggered:
|
|
26
|
-
- Integration tests
|
|
27
|
-
- End-to-end validation
|
|
28
|
-
- Cross-module compatibility tests
|
|
29
|
-
With publish Label:
|
|
18
|
+
๐ Reusable workflows for verification and release processes
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
# Additional workflow:
|
|
33
|
-
- Version validation (checks if version exists)
|
|
34
|
-
- Release candidate generation
|
|
35
|
-
- Pre-release npm build (with -dev suffix)
|
|
36
|
-
- Artifact creation
|
|
37
|
-
Both Labels (verify + publish):
|
|
20
|
+
๐ฆ Semantic versioning and automated releases
|
|
38
21
|
|
|
39
|
-
|
|
22
|
+
๐งช Linting, unit, integration, and E2E tests
|
|
40
23
|
|
|
41
|
-
|
|
24
|
+
๐ Branch protection rules and pull request label enforcement
|
|
42
25
|
|
|
43
|
-
|
|
26
|
+
## ๐งฉ CI/CD Workflow Logic
|
|
27
|
+
The pipeline behavior is controlled via pull request labels:
|
|
44
28
|
|
|
45
|
-
|
|
46
|
-
1. Development Phase
|
|
47
|
-
text
|
|
48
|
-
Developer โ Creates Feature Branch โ Makes Changes โ Opens PR
|
|
49
|
-
2. Pull Request Validation
|
|
50
|
-
text
|
|
51
|
-
PR Created โ Automatic Checks Run:
|
|
52
|
-
โโโ Code linting (ESLint/Prettier)
|
|
53
|
-
โโโ TypeScript compilation
|
|
54
|
-
โโโ Unit test execution
|
|
55
|
-
โโโ Dependency validation (package-lock.json)
|
|
56
|
-
โโโ Branch policy validation
|
|
57
|
-
3. Label Application
|
|
58
|
-
text
|
|
59
|
-
Maintainer Reviews โ Applies Labels:
|
|
60
|
-
โโโ `verify` โ Integration tests run
|
|
61
|
-
โโโ `publish` โ Release candidate generated
|
|
62
|
-
โโโ Both โ Full validation + release prep
|
|
63
|
-
4. Release Candidate Generation (Pre-Merge)
|
|
64
|
-
text
|
|
65
|
-
With `publish` label:
|
|
66
|
-
โโโ Version checked (must not exist on npm)
|
|
67
|
-
โโโ Pre-release version created (e.g., 1.2.3-dev-abc123)
|
|
68
|
-
โโโ Package built with dev suffix
|
|
69
|
-
โโโ Artifacts created
|
|
70
|
-
โโโ Ready for final review
|
|
71
|
-
5. Merge & Automatic Release
|
|
72
|
-
text
|
|
73
|
-
PR Merged โ Automatic Release:
|
|
74
|
-
โโโ Full validation (re-runs all checks)
|
|
75
|
-
โโโ Version bump validation
|
|
76
|
-
โโโ npm publication (@latest)
|
|
77
|
-
โโโ Git tag creation (vX.Y.Z)
|
|
78
|
-
โโโ GitHub Release generation
|
|
79
|
-
How to Trigger Deployments
|
|
80
|
-
Option 1: Standard Feature Development
|
|
81
|
-
bash
|
|
82
|
-
# 1. Create feature branch
|
|
83
|
-
git checkout -b feature/new-feature
|
|
29
|
+
verify โ runs integration and E2E tests
|
|
84
30
|
|
|
85
|
-
|
|
86
|
-
git add .
|
|
87
|
-
git commit -m "Add new feature"
|
|
31
|
+
publish โ prepares a release candidate and publishes artifacts
|
|
88
32
|
|
|
89
|
-
|
|
90
|
-
git push origin feature/new-feature
|
|
91
|
-
# Then create PR via GitHub UI
|
|
92
|
-
Option 2: Release Preparation
|
|
93
|
-
bash
|
|
94
|
-
# 1. Update package.json version
|
|
95
|
-
# Manually bump version following semver:
|
|
96
|
-
# - patch: 1.0.0 โ 1.0.1 (bug fixes)
|
|
97
|
-
# - minor: 1.0.0 โ 1.1.0 (new features, backward compatible)
|
|
98
|
-
# - major: 1.0.0 โ 2.0.0 (breaking changes)
|
|
33
|
+
verify + publish โ performs full validation and release flow
|
|
99
34
|
|
|
100
|
-
|
|
101
|
-
|
|
35
|
+
## ๐ Project Structure
|
|
36
|
+
.github/workflows/ # CI/CD workflows
|
|
102
37
|
|
|
103
|
-
#
|
|
104
|
-
npm version patch --no-git-tag-version
|
|
105
|
-
git add package.json package-lock.json
|
|
106
|
-
git commit -m "chore: bump version to 1.2.3"
|
|
38
|
+
src/ # Application source code
|
|
107
39
|
|
|
108
|
-
#
|
|
109
|
-
git push origin release/v1.2.3
|
|
40
|
+
tests/ # Unit and integration tests
|
|
110
41
|
|
|
111
|
-
#
|
|
112
|
-
# - Add `verify` label for integration tests
|
|
113
|
-
# - Add `publish` label for release candidate
|
|
114
|
-
Option 3: Hotfix Deployment
|
|
115
|
-
bash
|
|
116
|
-
# 1. Create hotfix from main
|
|
117
|
-
git checkout main
|
|
118
|
-
git pull
|
|
119
|
-
git checkout -b hotfix/critical-bug
|
|
42
|
+
package.json # Project configuration
|
|
120
43
|
|
|
121
|
-
#
|
|
122
|
-
npm version patch --no-git-tag-version
|
|
44
|
+
tsconfig.json # TypeScript configuration
|
|
123
45
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
git push origin hotfix/critical-bug
|
|
128
|
-
|
|
129
|
-
# 4. Create PR with both labels
|
|
130
|
-
# Labels: `verify` + `publish`
|
|
131
|
-
# Merge after approval โ Automatic deployment
|
|
132
|
-
Versioning Strategy
|
|
133
|
-
Pre-Merge vs Post-Merge Versioning
|
|
134
|
-
Pre-Merge (Development Builds)
|
|
135
|
-
Format: X.Y.Z-dev-<short-sha>
|
|
136
|
-
|
|
137
|
-
Example: 1.2.3-dev-abc123def
|
|
138
|
-
|
|
139
|
-
When used: During PR validation with publish label
|
|
140
|
-
|
|
141
|
-
Purpose: Test the exact build that will be published
|
|
142
|
-
|
|
143
|
-
npm tag: next or dev
|
|
144
|
-
|
|
145
|
-
Key characteristic: Unique per commit, not published as latest
|
|
146
|
-
|
|
147
|
-
Post-Merge (Production Release)
|
|
148
|
-
Format: X.Y.Z
|
|
149
|
-
|
|
150
|
-
Example: 1.2.3
|
|
151
|
-
|
|
152
|
-
When used: After PR merge to main
|
|
153
|
-
|
|
154
|
-
Purpose: Stable production release
|
|
155
|
-
|
|
156
|
-
npm tag: latest
|
|
157
|
-
|
|
158
|
-
Key characteristic: Stable, semantic version
|
|
159
|
-
|
|
160
|
-
Version Bump Rules
|
|
161
|
-
yaml
|
|
162
|
-
# In package.json, follow SemVer:
|
|
163
|
-
major.X.Y (2.0.0):
|
|
164
|
-
- Breaking API changes
|
|
165
|
-
- Incompatible with previous versions
|
|
166
|
-
|
|
167
|
-
minor.X.Y (1.3.0):
|
|
168
|
-
- New backward-compatible features
|
|
169
|
-
- Deprecated functionality (still working)
|
|
170
|
-
|
|
171
|
-
patch.X.Y (1.2.4):
|
|
172
|
-
- Bug fixes
|
|
173
|
-
- Performance improvements
|
|
174
|
-
- Documentation updates
|
|
175
|
-
Example Flow
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
Branch Protection Rules
|
|
189
|
-
Automated Setup
|
|
190
|
-
The pipeline automatically configures:
|
|
191
|
-
|
|
192
|
-
โ
Require PR before merging
|
|
193
|
-
|
|
194
|
-
โ
Require 1 approval minimum
|
|
195
|
-
|
|
196
|
-
โ
Require up-to-date branch
|
|
197
|
-
|
|
198
|
-
โ
Require status checks to pass
|
|
199
|
-
|
|
200
|
-
โ
Linear commit history (rebase only)
|
|
201
|
-
|
|
202
|
-
โ
Admin bypass enabled
|
|
203
|
-
|
|
204
|
-
โ No force pushes allowed
|
|
205
|
-
|
|
206
|
-
โ No branch deletions allowed
|
|
207
|
-
|
|
208
|
-
Manual Override
|
|
209
|
-
Admins can merge even if checks fail (for emergency fixes).
|
|
210
|
-
|
|
211
|
-
Reusable Workflows
|
|
212
|
-
Location
|
|
213
|
-
text
|
|
214
|
-
maksim-sialitski-innowise/devops-automation/
|
|
215
|
-
โโโ .github/workflows/
|
|
216
|
-
โโโ pr-verification.yml # PR validation
|
|
217
|
-
โโโ integration-tests.yml # Label: verify
|
|
218
|
-
โโโ publish-release.yml # Label: publish + release
|
|
219
|
-
โโโ setup-repository.yml # Branch protection
|
|
220
|
-
Usage in Projects
|
|
221
|
-
yaml
|
|
222
|
-
# In your project's .github/workflows/ci-cd.yml
|
|
223
|
-
jobs:
|
|
224
|
-
verification:
|
|
225
|
-
uses: maksim-sialitski-innowise/devops-automation/.github/workflows/pr-verification.yml@main
|
|
226
|
-
|
|
227
|
-
integration:
|
|
228
|
-
if: contains(github.event.pull_request.labels.*.name, 'verify')
|
|
229
|
-
uses: maksim-sialitski-innowise/devops-automation/.github/workflows/integration-tests.yml@main
|
|
230
|
-
Troubleshooting
|
|
231
|
-
Common Issues
|
|
232
|
-
PR checks not running
|
|
233
|
-
|
|
234
|
-
Ensure branch is up-to-date with main
|
|
235
|
-
|
|
236
|
-
Check if package-lock.json is committed
|
|
237
|
-
|
|
238
|
-
Version already exists error
|
|
239
|
-
|
|
240
|
-
Bump version in package.json
|
|
241
|
-
|
|
242
|
-
Ensure unique version for each release
|
|
243
|
-
|
|
244
|
-
Label not triggering workflows
|
|
245
|
-
|
|
246
|
-
Labels are case-sensitive
|
|
247
|
-
|
|
248
|
-
Wait for GitHub to register label changes
|
|
249
|
-
|
|
250
|
-
npm publish failure
|
|
251
|
-
|
|
252
|
-
Check NPM_TOKEN secret exists
|
|
253
|
-
|
|
254
|
-
Verify package name is available
|
|
255
|
-
|
|
256
|
-
Emergency Procedures
|
|
257
|
-
Bypass all checks (Admin only):
|
|
258
|
-
|
|
259
|
-
bash
|
|
260
|
-
# 1. Temporarily disable branch protection
|
|
261
|
-
# 2. Push directly to main
|
|
262
|
-
# 3. Re-enable protection
|
|
263
|
-
# 4. Create follow-up PR to fix pipeline
|
|
264
|
-
|
|
265
|
-
Support
|
|
266
|
-
For pipeline issues, check:
|
|
267
|
-
GitHub Actions logs
|
|
268
|
-
npm audit results
|
|
269
|
-
TypeScript compilation errors
|
|
270
|
-
Test execution reports
|
|
46
|
+
## ๐ค Contributing
|
|
47
|
+
Contributions are welcome.
|
|
48
|
+
Please follow semantic commit conventions, keep your branch up to date, and use pull request labels to trigger the appropriate workflows.
|
package/dist/index.js
CHANGED