Skip to content

Commit

Permalink
add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-peruzzo committed Jan 24, 2025
1 parent a8be824 commit 225121f
Show file tree
Hide file tree
Showing 4 changed files with 1,262 additions and 13 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## [0.1.3](https://github.com/keycloakify/keycloakify-svelte/compare/v0.1.2...v0.1.3) (2025-01-03)



## [0.1.2](https://github.com/keycloakify/keycloakify-svelte/compare/v0.1.1...v0.1.2) (2025-01-03)



## [0.1.1](https://github.com/keycloakify/keycloakify-svelte/compare/v0.1.0...v0.1.1) (2025-01-02)



# [0.1.0](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.7...v0.1.0) (2024-12-30)



## [0.0.1-rc.7](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.6...v0.0.1-rc.7) (2024-11-28)



## [0.0.1-rc.6](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.5...v0.0.1-rc.6) (2024-11-28)



## [0.0.1-rc.5](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.4...v0.0.1-rc.5) (2024-11-26)



## [0.0.1-rc.4](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.3...v0.0.1-rc.4) (2024-11-26)



## [0.0.1-rc.3](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.2...v0.0.1-rc.3) (2024-11-26)



## [0.0.1-rc.2](https://github.com/keycloakify/keycloakify-svelte/compare/v0.0.1-rc.1...v0.0.1-rc.2) (2024-11-26)



## [0.0.1-rc.1](https://github.com/keycloakify/keycloakify-svelte/compare/ac5015a40b34b7f358080c842c764d4bfea01f7b...v0.0.1-rc.1) (2024-11-26)


### Reverts

* Revert "temporary add dist" ([ac5015a](https://github.com/keycloakify/keycloakify-svelte/commit/ac5015a40b34b7f358080c842c764d4bfea01f7b))



6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@
"svelte:check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"_format": "prettier '**/*.{ts,html,json,md,svelte}'",
"format": "yarn _format --write",
"lint": "yarn format && eslint . --fix"
"lint": "yarn format && eslint . --fix",
"changelog": "npx conventional-changelog -t -p angular -i CHANGELOG.md -s -r 0",
"release": "sh scripts/release.sh"
},
"peerDependencies": {
"keycloakify": "^11.7.0",
Expand All @@ -441,6 +443,8 @@
"@types/eslint": "^9.6.1",
"@types/node": "^22.10.7",
"@vercel/ncc": "^0.38.3",
"conventional-changelog-cli": "^5.0.0",
"cz-conventional-changelog": "^3.3.0",
"cli-select": "^1.1.2",
"eslint": "9.18.0",
"eslint-config-prettier": "^10.0.1",
Expand Down
85 changes: 85 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/sh

# Increments the project version (e.g. from 2.3.0 to 2.4.0)
# It handles stuff like
# * CHANGELOG
# * Package version
# * Git tags

# Credits for original version to Luca Ravizzotti

# Calculating the new version requires to know which kind of update this is
# The default version increment is patch
# Used values: major|minor|patch where in x.y.z :
# major=x
# minor=y
# patch=z

while getopts ":v:r" arg; do
case $arg in
v) versionType=$OPTARG ;;
r) releaseType=$OPTARG ;;
*)
printf "\n"
printf "%s -v [none|patch|minor|major] -r [rel]" "$0"
printf "\n"
printf "\n\t -v version type, default: none"
printf "\n\t -r release type, default: rel"
printf "\n\n"
exit 0
;;
esac
done

# Version type = none|patch|minor|major
if [ -z "$versionType" ]; then
versionType="none"
fi
if [ "$versionType" != "none" ] && [ "$versionType" != "patch" ] && [ "$versionType" != "minor" ] && [ "$versionType" != "major" ]; then
echo "Version type not supported, try with -h for help"
exit 1
fi

# Release type = pre|rc|fix|rel
if [ -z "$releaseType" ] || [ "$releaseType" = "rel" ]; then
releaseType=""
fi
if [ "$releaseType" != "" ]; then
echo "Release type not supported, try with -h for help"
exit 1
fi

# Get current git branch name
branch=$(git rev-parse --abbrev-ref HEAD)

if [ "$branch" != "main" ]; then
echo "Release can be done only on main branch"
exit 1
fi

if [ "$branch" = "main" ] && [ "$releaseType" != "" ]; then
echo "Release type not supported on main branch"
exit 1
fi

# Version bump only if needed
if [ "$versionType" != "none" ]; then
if [ "$releaseType" = "" ]; then
# Increment version without creating a tag and a commit (we will create them later)
npm --no-git-tag-version version "$versionType" || exit 1
fi
fi

# Using the package.json version
version="$(jq -r '.version' "$(dirname "$0")/../package.json")"

# changelog
if [ "$versionType" != "none" ]; then
rm CHANGELOG.md
npm run changelog
git add package.json yarn.lock CHANGELOG.md
git commit -m "chore(version): 💯 bump version to $version"
# Gotta push them all
git push
fi

Loading

0 comments on commit 225121f

Please sign in to comment.