Skip to content

Commit c3ecf1d

Browse files
Add github actions for build verification and releases.
1 parent f6cc786 commit c3ecf1d

9 files changed

Lines changed: 432 additions & 218 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sh text eol=lf

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Fetch all history for tags and branches
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: '9.0.x'
21+
22+
- name: Fix line endings and run build script
23+
run: |
24+
sed -i 's/\r$//' ./build_check_release.sh
25+
chmod +x ./build_check_release.sh
26+
./build_check_release.sh
27+
28+
- name: Upload build artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: check-release-builds
32+
path: check_release_dist/
33+
retention-days: 7

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'release/v*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0 # Fetch all history for tags and branches
15+
16+
- name: Extract version from tag
17+
id: get_version
18+
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/release/v})" >> $GITHUB_OUTPUT
19+
20+
- name: Update version in project file
21+
run: |
22+
VERSION=${{ steps.get_version.outputs.VERSION }}
23+
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/g" CheckRelease.csproj
24+
# If Version tag doesn't exist, add it
25+
if ! grep -q "<Version>" CheckRelease.csproj; then
26+
sed -i "/<PropertyGroup>/a \ <Version>$VERSION<\/Version>" CheckRelease.csproj
27+
fi
28+
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
dotnet-version: '9.0.x'
33+
34+
- name: Fix line endings and build release
35+
run: |
36+
sed -i 's/\r$//' ./build_check_release.sh
37+
chmod +x ./build_check_release.sh
38+
./build_check_release.sh
39+
40+
- name: Create Release
41+
id: create_release
42+
uses: softprops/action-gh-release@v1
43+
with:
44+
name: Release v${{ steps.get_version.outputs.VERSION }}
45+
draft: false
46+
prerelease: false
47+
files: |
48+
check_release_dist/win-x64/check_release.win-x64.exe
49+
check_release_dist/win-arm64/check_release.win-arm64.exe
50+
check_release_dist/linux-x64/check_release.linux-x64
51+
check_release_dist/linux-arm64/check_release.linux-arm64
52+
check_release_dist/osx-x64/check_release.osx-x64
53+
check_release_dist/osx-arm64/check_release.osx-arm64
54+
generate_release_notes: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ publish/
22
obj/
33
bin/
44
check_release_dist/
5-
.vs/
5+
.vs/
6+
memory-bank/

CONTRIBUTING.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,28 @@ We welcome suggestions for new features or improvements:
6969
- Update documentation as needed
7070
- Add a clear description of your changes
7171

72-
## Versioning Guidelines
72+
### Continuous Integration
73+
74+
All pull requests are automatically built and tested using GitHub Actions. The following checks will run:
75+
76+
1. **Build and Test**: Runs the `build_check_release.sh` script to:
77+
- Execute all tests
78+
- Build the application for all supported architectures
79+
- Ensure everything compiles correctly
80+
81+
Pull requests cannot be merged until all checks pass. This helps maintain code quality and ensures that changes don't break existing functionality.
82+
83+
### Branch Protection
84+
85+
The main branch is protected with the following rules:
86+
87+
1. Pull requests must be reviewed and approved before merging
88+
2. The "Build and Test" workflow must pass before merging
89+
3. Direct pushes to the main branch are not allowed
90+
91+
These protections help ensure that only high-quality, tested code is merged into the main branch.
92+
93+
## Versioning and Release Guidelines
7394

7495
This project follows [Semantic Versioning (SEMVER)](https://semver.org/). When contributing, please indicate the type of change:
7596

@@ -88,6 +109,8 @@ This project follows [Semantic Versioning (SEMVER)](https://semver.org/). When c
88109
- Performance improvements
89110
- Documentation updates
90111

112+
For detailed information about the release process, please see [RELEASING.md](docs/RELEASING.md).
113+
91114
## Coding Standards
92115

93116
We value clean, readable code but don't want to burden contributors with overly strict guidelines. Here are some basic principles:

CheckRelease.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<PublishTrimmed>true</PublishTrimmed>
99
<TrimMode>link</TrimMode>
1010
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
11+
<Version>1.0.0</Version>
1112
</PropertyGroup>
1213

1314
<ItemGroup>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
[![.NET](https://img.shields.io/badge/.NET-9.0-512BD4)](https://dotnet.microsoft.com/download/dotnet/9.0)
55
[![Version](https://img.shields.io/badge/Version-1.0.0-blue)](https://github.com/SkywardApps/check-release/releases)
6+
[![Build Status](https://github.com/SkywardApps/check-release/actions/workflows/build.yml/badge.svg)](https://github.com/SkywardApps/check-release/actions/workflows/build.yml)
7+
[![Release Status](https://github.com/SkywardApps/check-release/actions/workflows/release.yml/badge.svg)](https://github.com/SkywardApps/check-release/actions/workflows/release.yml)
68

79
A C# tool for analyzing and displaying changes between Git tags with JIRA ticket extraction and Slack unfurling support.
810

0 commit comments

Comments
 (0)