-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from buerokratt/dev
Merging dev to test
- Loading branch information
Showing
71 changed files
with
1,744 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
RELEASE=PRE-ALPHA-test | ||
VERSION=1 | ||
BUILD=1 | ||
FIX=5 | ||
FIX=36 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Bug report | ||
about: For reporting bugs | ||
title: "[BUG]" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Bug description:** | ||
|
||
|
||
**Expected behavior:** | ||
|
||
|
||
**Screenshots:** | ||
|
||
|
||
**Additional information:** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: Feature request | ||
about: New feature or enhancement | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**AS A** *role or user type* | ||
**I WANT** *the feature or functionality desired* | ||
**SO THAT** *desired outcome or goal* | ||
|
||
### Acceptance Criteria | ||
|
||
- [ ] ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Check Version | ||
|
||
on: | ||
push: | ||
branches: ["test", "stage", "main"] | ||
workflow_dispatch: | ||
|
||
env: | ||
BRANCH: ${{ github.head_ref || github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Docker Setup BuildX | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Bump Patch Version | ||
run: npm run bump-patch | ||
if: ${{ env.BRANCH == 'test' }} | ||
|
||
- name: Sync Version | ||
run: npm run sync-version | ||
if: ${{ env.BRANCH != 'test' }} | ||
|
||
- name: Generate Changelog | ||
run: npm run changelog | ||
|
||
- name: Push changes to repo | ||
run: | | ||
git config --global user.name ${{ secrets.ADMIN_NAME }} | ||
git config --global user.email ${{ secrets.ADMIN_EMAIL }} | ||
git add . | ||
git commit -m "docs: update version" | ||
git push | ||
- name: Load environment variables | ||
run: | | ||
awk -v branch="${{ env.BRANCH }}" ' /^[0-9a-zA-Z]+$/ { current_branch = $0; } current_branch == branch && /^[A-Z_]+=/{ print $0; }' release.env >> $GITHUB_ENV | ||
- name: Set repo | ||
run: | | ||
LOWER_CASE_GITHUB_REPOSITORY=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]') | ||
echo "DOCKER_TAG_CUSTOM=ghcr.io/${LOWER_CASE_GITHUB_REPOSITORY}:v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" >> $GITHUB_ENV | ||
echo "$GITHUB_ENV" | ||
- name: Build Docker image | ||
run: | | ||
echo "Building Docker image for branch: ${{ env.BRANCH }} major: ${{ env.MAJOR }} minor: ${{ env.MINOR }} patch: ${{ env.PATCH }}" | ||
docker image build --tag $DOCKER_TAG_CUSTOM --no-cache . | ||
if: ${{ env.BRANCH == 'test' }} | ||
|
||
- name: Log in to GitHub container registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
|
||
- name: Push Docker image to GitHub Packages | ||
run: | | ||
echo "Pushing Docker image to GitHub Packages" | ||
docker push $DOCKER_TAG_CUSTOM | ||
if: ${{ env.BRANCH == 'test' }} | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
if: ${{ env.BRANCH == 'main' }} | ||
with: | ||
tag_name: v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }} | ||
generate_release_notes: true | ||
body_path: ${{ github.workspace }}/CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# !/bin/bash | ||
|
||
message="$(head -1 $1)" | ||
|
||
message_pattern="^(feat|fix|chore|docs|refactor|style|test)\([0-9]+\):\ .+$" | ||
|
||
if ! [[ $message =~ $message_pattern ]]; | ||
then | ||
echo "---" | ||
echo "Violation of commit message format!" | ||
echo "The commit message must follow the Conventional Commits standard:" | ||
echo "[type(scope): description]" | ||
echo "Example: feat(100): Implement automated pipeline for code commits" | ||
echo "Accepted types: feat, fix, chore, docs, refactor, style, test" | ||
echo "(1) feat: Added a new feature" | ||
echo "(2) fix: Fixed a bug" | ||
echo "(3) chore: Added changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)" | ||
echo "(4) docs: Added updates to documentation such as a the README or other markdown files" | ||
echo "(5) refactor: Refactored code that neither fixes a bug nor adds a feature" | ||
echo "(6) style: Added Changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on" | ||
echo "(7) test: Included new or corrected previous tests" | ||
echo "---" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,7 @@ | ||
## v1.0.0-alpha.1 (2024-05-15) | ||
|
||
> Description | ||
### Upgrade Steps | ||
|
||
- [ACTION REQUIRED] | ||
- | ||
## [v2.0.0](https://github.com/buerokratt/Chat-Widget/compare/main...dev) | ||
|
||
### Breaking Changes | ||
|
||
- | ||
- | ||
|
||
### New Features | ||
|
||
- | ||
- | ||
|
||
### Bug Fixes | ||
|
||
- | ||
- | ||
|
||
### Performance Improvements | ||
|
||
- | ||
- | ||
|
||
### Other Changes | ||
|
||
- | ||
- | ||
- Added Software Versioning [#561](https://github.com/buerokratt/Buerokratt-Chatbot/issues/561) | ||
- Removed bugs and vulnerabilites [#5](https://github.com/buerokratt/Test-Driven-Development/issues/5) | ||
- Serve static content on ngnix [#612](https://github.com/buerokratt/Buerokratt-Chatbot/issues/612) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to bump the version number based on the bump type provided to the current branch. | ||
|
||
# Check if the bump type is provided | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 {major|minor|patch}" | ||
exit 1 | ||
fi | ||
|
||
# Get the current branch name | ||
current_branch=$(git branch --show-current) | ||
|
||
# Initialize variables | ||
found_branch=false | ||
bump_type=$1 | ||
|
||
# Read the environment content from the file | ||
env_file=$(<release.env) | ||
|
||
# Get the version based on the current branch | ||
while IFS= read -r line; do | ||
if [ "$line" == "$current_branch" ]; then | ||
found_branch=true | ||
elif [ "$found_branch" == true ]; then | ||
if [[ "$line" == MAJOR=* || "$line" == MINOR=* || "$line" == PATCH=* ]]; then | ||
var_name="${line%%=*}" | ||
var_value="${line#*=}" | ||
|
||
if [[ "$var_name" == "MAJOR" || "$var_name" == "MINOR" || "$var_name" == "PATCH" ]]; then | ||
declare -i "$var_name=$var_value" | ||
fi | ||
else | ||
break | ||
fi | ||
fi | ||
done <<< "$env_file" | ||
|
||
# Increment the version number based on the bump type | ||
if [ "$found_branch" == true ]; then | ||
case "$bump_type" in | ||
major) | ||
MAJOR=$((MAJOR + 1)) | ||
MINOR=0 | ||
PATCH=0 | ||
;; | ||
minor) | ||
MINOR=$((MINOR + 1)) | ||
PATCH=0 | ||
;; | ||
patch) | ||
PATCH=$((PATCH + 1)) | ||
;; | ||
*) | ||
echo "Invalid bump type: $bump_type" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
updated_content=$(awk -v branch="$current_branch" -v major="$MAJOR" -v minor="$MINOR" -v patch="$PATCH" ' | ||
BEGIN { found = 0 } | ||
$0 == branch { | ||
print $0; | ||
found=1; | ||
next | ||
} | ||
# If the branch was found, replace MAJOR, MINOR, and PATCH values | ||
found && $0 ~ /^MAJOR=/ { | ||
print "MAJOR=" major | ||
next | ||
} | ||
found && $0 ~ /^MINOR=/ { | ||
print "MINOR=" minor | ||
next | ||
} | ||
found && $0 ~ /^PATCH=/ { | ||
print "PATCH=" patch | ||
next | ||
} | ||
# Check for the start of a new branch. If a new branch is found, stop processing the values of the previous branch. | ||
/^[a-zA-Z]+$/ { | ||
if (found) { | ||
found = 0 # Reset found when a new branch is encountered | ||
} | ||
} | ||
# If we have not found the branch yet, just print the line | ||
{ print $0 } | ||
' release.env) | ||
|
||
echo -e "$updated_content" > "release.env" | ||
fi |
Oops, something went wrong.