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.
Files changed (3) hide show
  1. package/README.md +27 -249
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,270 +1,48 @@
1
- CI/CD Pipeline Documentation
1
+ # Tether - CI/CD Pipeline Implementation
2
2
 
3
- Overview
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
- Labels System
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
- Linting
7
+ ### Development
15
8
 
16
- Build
9
+ npm install
17
10
 
18
- Unit tests
11
+ npm run build
19
12
 
20
- Branch validation (up-to-date with main, linear history)
13
+ npm test
21
14
 
22
- With verify Label:
15
+ ## ๐Ÿ›  Features
16
+ โœ… Fully automated CI/CD pipeline using GitHub Actions
23
17
 
24
- yaml
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
- yaml
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
- Runs all verification steps
22
+ ๐Ÿงช Linting, unit, integration, and E2E tests
40
23
 
41
- Generates release candidate
24
+ ๐Ÿ” Branch protection rules and pull request label enforcement
42
25
 
43
- Performs full validation before merge
26
+ ## ๐Ÿงฉ CI/CD Workflow Logic
27
+ The pipeline behavior is controlled via pull request labels:
44
28
 
45
- Release Process Flow
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
- # 2. Make changes and commit
86
- git add .
87
- git commit -m "Add new feature"
31
+ publish โ€” prepares a release candidate and publishes artifacts
88
32
 
89
- # 3. Push and create PR
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
- # 2. Create release branch
101
- git checkout -b release/v1.2.3
35
+ ## ๐Ÿ“ Project Structure
36
+ .github/workflows/ # CI/CD workflows
102
37
 
103
- # 3. Update version and commit
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
- # 4. Push and create PR
109
- git push origin release/v1.2.3
40
+ tests/ # Unit and integration tests
110
41
 
111
- # 5. Add labels via GitHub UI:
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
- # 2. Fix the issue and bump patch version
122
- npm version patch --no-git-tag-version
44
+ tsconfig.json # TypeScript configuration
123
45
 
124
- # 3. Commit and push
125
- git add .
126
- git commit -m "fix: critical bug resolution"
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
@@ -4,7 +4,7 @@ exports.sum = sum;
4
4
  function sum(a, b) {
5
5
  return a + b;
6
6
  }
7
- // test commit8
7
+ // test commit9
8
8
  const result = sum(3, 5);
9
9
  console.log("Result:", result);
10
10
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-ts-sum",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "TypeScript package with sum function for CI/CD demo",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",