Skip to content

Commit 10f0bb4

Browse files
authored
Feature/changelog release (#131)
1 parent 018c006 commit 10f0bb4

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

.github/workflows/release.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*.*.*"
10+
11+
workflow_run:
12+
workflows: ["pre-commit"]
13+
types:
14+
- completed
15+
16+
jobs:
17+
release:
18+
name: Release Job
19+
runs-on: ubuntu-latest
20+
if: startsWith(github.ref, 'refs/tags/v')
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Install go (required for Changelog parsing)
26+
uses: actions/setup-go@v4
27+
28+
- name: Parse CHANGELOG.md
29+
run: |
30+
GO111MODULE=on go install github.com/rcmachado/[email protected]
31+
changelog show "$GITHUB_REF_NAME" > ${{ github.workspace }}-CHANGELOG.txt
32+
echo "Release note for $GITHUB_REF_NAME :"
33+
cat ${{ github.workspace }}-CHANGELOG.txt
34+
35+
- name: Release
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
body_path: ${{ github.workspace }}-CHANGELOG.txt
39+
files: |
40+
LICENSE
41+
CHANGELOG.md

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [v-0.0.1](https://github.com/ansible/product-demos/-/tree/v-0.0.1) - 2024-01-12
9+
10+
### Added
11+
12+
- Initial release ([1af584b4ea6d77812bfcb2f6474fee6ee1b13666](https://github.com/ansible/product-demos/-/commit/1af584b4ea6d77812bfcb2f6474fee6ee1b13666))

CONTRIBUTING.md

+73
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,76 @@ Copy the token value and execute the following command:
7272
```bash
7373
export ANSIBLE_GALAXY_SERVER_AH_TOKEN=<token>
7474
```
75+
76+
## Release Process
77+
78+
We follow a structured release process for this project. Here are the steps involved:
79+
80+
1. **Create a Release Branch:**
81+
- Start by creating a new release branch from the `main` branch.
82+
83+
```bash
84+
git checkout -b release/v-<version>
85+
```
86+
87+
2. **Update Changelog:**
88+
- Open the `CHANGELOG.md` file to manually add your change to the appropriate section.
89+
- Our changelog follows the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format and includes the following categories of changes:
90+
91+
- `Added` for new features.
92+
- `Changed` for changes in existing functionality.
93+
- `Deprecated` for features that will be removed in upcoming releases.
94+
- `Fixed` for bug fixes.
95+
- `Removed` for deprecated features that were removed.
96+
- `Security` for security-related changes.
97+
98+
- Add a new entry under the relevant category. Include a brief summary of the change and the merge request commit tag.
99+
100+
```markdown
101+
## [Unreleased]
102+
103+
### Added
104+
105+
- New feature or enhancement ([Merge Request Commit](https://github.com/ansible/product-demos/-/commit/<commit-hash>))
106+
```
107+
108+
- Replace `<commit-hash>` with the actual commit hash from the merge request.
109+
110+
3. **Commit Changes:**
111+
- Commit the changes made to the `CHANGELOG.md` file.
112+
113+
```bash
114+
git add CHANGELOG.md
115+
git commit -m "Update CHANGELOG for release <version>"
116+
```
117+
118+
4. **Create a Pull Request:**
119+
- Open a pull request from the release branch to the `main` branch.
120+
121+
5. **Review and Merge:**
122+
- Review the pull request and merge it into the `main` branch.
123+
124+
6. **Tag the Release:**
125+
- Once the pull request is merged, tag the release with the version number.
126+
127+
```bash
128+
git tag -a v-<version> -m "Release <version>"
129+
git push origin v-<version>
130+
```
131+
132+
7. **Publish the Release:**
133+
- After the successful completion of the pull request and merging into the `main` branch, an automatic GitHub Action will be triggered to publish the release.
134+
135+
The GitHub Action will perform the following steps:
136+
- Parse the `CHANGELOG.md` file.
137+
- Generate a release note based on the changes.
138+
- Attach relevant files (such as `LICENSE`, `CHANGELOG.md`, and the generated `CHANGELOG.txt`) to the GitHub Release.
139+
140+
No manual intervention is required for this step; the GitHub Action will handle the release process automatically.
141+
142+
8. **Cleanup:**
143+
- Delete the release branch.
144+
145+
```bash
146+
git branch -d release/v-<version>
147+
```

0 commit comments

Comments
 (0)