Skip to content

Commit 7bfbf98

Browse files
committed
refactor: exclude example directory from CI/CD pipelines
1 parent 7a19601 commit 7bfbf98

5 files changed

Lines changed: 23 additions & 43 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ on:
44
push:
55
branches: [main]
66
tags: ['v*']
7+
paths-ignore: ['example/**']
78
pull_request:
89
branches: [main]
10+
paths-ignore: ['example/**']
911

1012
jobs:
1113
test:

.github/workflows/example.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Release
33
on:
44
push:
55
tags: ['v*']
6+
paths-ignore: ['example/**']
67

78
jobs:
89
release:

docs/CI-CD-SETUP.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ This guide will help you set up automated testing, building, and publishing for
2727

2828
## Step 3: Verify GitHub Actions Workflows
2929

30-
The following workflows are already configured:
30+
The following workflows are configured:
3131

3232
### `ci.yml` - Continuous Integration
33-
- **Triggers**: Push to main, pull requests, version tags
33+
- **Triggers**: Push to main, pull requests, version tags (excludes example directory)
3434
- **Actions**: Runs tests, linting, and builds
3535
- **Purpose**: Ensures code quality on every change
3636

3737
### `release.yml` - Automated Releases
38-
- **Triggers**: Version tags (e.g., `v1.0.0`)
38+
- **Triggers**: Version tags (e.g., `v1.0.0`) (excludes example directory)
3939
- **Actions**: Publishes to npm, creates GitHub release
4040
- **Purpose**: Automated package publishing
4141

42-
### `example.yml` - Example Build
43-
- **Triggers**: Changes to example directory
44-
- **Actions**: Builds the example application
45-
- **Purpose**: Ensures example code works
42+
### Important Notes
43+
- **Example directory changes do NOT trigger pipelines** - The example is for demonstration only
44+
- **Only changes to the main library code** will trigger CI/CD workflows
45+
- **Version tags trigger releases** regardless of what files changed
4646

4747
## Step 4: Test the Setup
4848

@@ -115,6 +115,11 @@ git push origin vX.Y.Z
115115
- Verify all dependencies are installed
116116
- Check for missing files in the build
117117

118+
**"Pipeline not triggering"**
119+
- Ensure you're not only changing files in the `example/` directory
120+
- Check that your changes are in the `lib/` directory or root files
121+
- Verify you're pushing to the main branch
122+
118123
### Getting Help
119124

120125
1. Check the GitHub Actions logs for detailed error messages
@@ -129,6 +134,7 @@ git push origin vX.Y.Z
129134
3. **Write good commit messages** for better release notes
130135
4. **Review the generated release notes** before publishing
131136
5. **Test the published package** in a new project
137+
6. **Keep example changes separate** from library changes
132138

133139
## Security Notes
134140

lib/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,14 @@ This project uses GitHub Actions for continuous integration and deployment:
264264

265265
### Workflows
266266

267-
- **CI/CD** (`ci.yml`): Runs tests and linting on every push/PR
267+
- **CI/CD** (`ci.yml`): Runs tests and linting on every push/PR (excludes example directory)
268268
- **Release** (`release.yml`): Publishes to npm and creates GitHub releases on version tags
269-
- **Example Build** (`example.yml`): Ensures the example application builds correctly
269+
270+
### Important Notes
271+
272+
- **Example directory changes do NOT trigger pipelines** - The example is for demonstration only
273+
- **Only changes to the main library code** will trigger CI/CD workflows
274+
- **Version tags trigger releases** regardless of what files changed
270275

271276
### Release Process
272277

0 commit comments

Comments
 (0)