Skip to content

Commit 6f87086

Browse files
chore(ci): generate GitHub releases based on commits (#198)
* chore(ci): generate GitHub releases based on commits * docs: outline release process * chore(ci): accommodate master branch name
1 parent e222141 commit 6f87086

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/release.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Get next version with semver-action
20+
id: semver
21+
uses: ietf-tools/semver-action@v1
22+
with:
23+
branch: main
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Create tag
27+
run: |
28+
git tag ${{ steps.semver.outputs.next }}
29+
git tag ${{ steps.semver.outputs.nextMajor }}
30+
31+
- name: Push tag
32+
run: git push --tags --force
33+
34+
- name: Create GitHub Release with gh cli
35+
run: gh release create ${{ steps.semver.outputs.next }} --generate-notes
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,33 @@
33
To ensure the long-term stability and quality of this project, we are moving to a closed-contribution model effective August 2025. This change allows our core team to focus on a centralized development roadmap and rigorous quality assurance, which is essential for a component with such extensive usage.
44

55
All of our development will remain public for transparency. We thank the community for its support and valuable contributions.
6+
7+
Here is an adjusted `CONTRIBUTING.md` file designed for both external users and Snyk engineers. It clearly separates the public-facing policy from the internal-facing development and release instructions.
8+
9+
-----
10+
11+
## **Internal Contributions (for Snyk Engineers)**
12+
13+
### **The Release Process**
14+
15+
Our project uses an automated release workflow to ensure new versions are consistent and error-free. The release is [triggered automatically](./.github/workflows/release.yaml) whenever a pull request is merged into the `main` branch.
16+
17+
The process uses [semantic versioning](https://semver.org/) to automatically determine the next version number based on the [commit messages](https://www.conventionalcommits.org/en/v1.0.0/) in the merged pull request.
18+
19+
### **How to Trigger a Major Version Change**
20+
21+
A major version change (e.g., `v1.x.x` to `v2.0.0`) is reserved for significant, **breaking changes** to the project.
22+
23+
To trigger a major version bump, your pull request **must** contain at least one commit message that includes the `BREAKING CHANGE:` footer.
24+
25+
**Example Commit Message:**
26+
27+
```text
28+
feat: Add a new API endpoint for user authentication
29+
30+
This commit introduces a new /api/v1/auth endpoint.
31+
32+
BREAKING CHANGE: The old authentication method is no longer supported. Please use the new endpoint.
33+
```
34+
35+
The presence of this specific footer signals to the automated release workflow that a new major version is required. Without it, the workflow will only increment the patch or minor version.

0 commit comments

Comments
 (0)