feat: added shepard
This commit is contained in:
parent
4807c7f497
commit
9347123018
6
CHANGELOG.md
Normal file
6
CHANGELOG.md
Normal file
@ -0,0 +1,6 @@
|
||||
## 0.2.0 (2024-01-09)
|
||||
|
||||
* feat: added release please ([4807c7f](https://gitea/tylerg/release-please/commits/4807c7f))
|
||||
* build: add commit lint w/hook ([40b7a52](https://gitea/tylerg/release-please/commits/40b7a52))
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ci-logs-and-version-mgnt",
|
||||
"version": "0.0.1",
|
||||
"version": "0.2.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@ -12,7 +12,8 @@
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^18.4.4",
|
||||
"@commitlint/config-angular": "^18.4.4",
|
||||
"husky": "^8.0.3",
|
||||
"release-please": "^16.7.0"
|
||||
"conventional-changelog-cli": "^4.1.0",
|
||||
"conventional-recommended-bump": "^9.0.0",
|
||||
"husky": "^8.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
921
pnpm-lock.yaml
generated
921
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
41
scripts/clog
Executable file
41
scripts/clog
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# Conventional ChangeLog Wrapper Script: clog
|
||||
|
||||
function bump {
|
||||
releaseType=$(npx conventional-recommended-bump -p angular)
|
||||
bumpVersion=$(pnpm version $releaseType --no-git-tag-version)
|
||||
|
||||
echo "Release Type: $releaseType"
|
||||
echo "Bump Version: $bumpVersion"
|
||||
}
|
||||
|
||||
|
||||
function log {
|
||||
ret=$(npx conventional-changelog \
|
||||
--preset $PRESET \
|
||||
--infile ../CHANGELOG.md \
|
||||
--same-file
|
||||
)
|
||||
|
||||
echo $ret
|
||||
}
|
||||
|
||||
function logReset {
|
||||
ret=$(npx conventional-changelog \
|
||||
--preset $PRESET \
|
||||
--infile ../CHANGELOG.md \
|
||||
--same-file \
|
||||
--release-count 0
|
||||
)
|
||||
echo $ret
|
||||
}
|
||||
|
||||
function logHelp {
|
||||
npx conventional-changelog --help
|
||||
}
|
||||
|
||||
|
||||
|
||||
# main
|
||||
source ./sheep; sheep $@
|
||||
|
||||
49
scripts/conv-clog-lib
Normal file
49
scripts/conv-clog-lib
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# ConventionalChange Log Wrapper Library: conv-clog
|
||||
|
||||
function bump {
|
||||
releaseType=$(npx conventional-recommended-bump -p angular)
|
||||
bumpVersion=$(pnpm version $releaseType --no-git-tag-version)
|
||||
|
||||
echo "Release Type: $releaseType"
|
||||
echo "Bump Version: $bumpVersion"
|
||||
}
|
||||
|
||||
|
||||
function log {
|
||||
ret=$(npx conventional-changelog \
|
||||
--preset $PRESET \
|
||||
--infile ../CHANGELOG.md \
|
||||
--same-file
|
||||
)
|
||||
|
||||
echo $ret
|
||||
}
|
||||
|
||||
|
||||
function logReset {
|
||||
ret=$(npx conventional-changelog \
|
||||
--preset $PRESET \
|
||||
--infile ../CHANGELOG.md \
|
||||
--same-file
|
||||
--release-log 0
|
||||
)
|
||||
echo $ret
|
||||
}
|
||||
|
||||
|
||||
function logHelp {
|
||||
npx conventional-changelog --help
|
||||
}
|
||||
|
||||
# ToDo: Not in use: release-please bootstrap calls POST on git/refs api, which gitea does not support.
|
||||
function preRelBootstrap {
|
||||
npx release-please bootstrap \
|
||||
--token=$TOKEN \
|
||||
--api-url="$GIT_URL" \
|
||||
--repo-url=$OWNER/$REPO \
|
||||
--release-type=$TYPE \
|
||||
--dry-run
|
||||
}
|
||||
|
||||
|
||||
28
scripts/gitea
Executable file
28
scripts/gitea
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Conventional ChangeLog Wrapper Script: clog
|
||||
|
||||
function githubRelease {
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer <YOUR-TOKEN>" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/OWNER/REPO/releases \
|
||||
-d '{"tag_name":"v1.0.0","target_commitish":"master","name":"v1.0.0","body":"Description of the release","draft":false,"prerelease":false,"generate_release_notes":false}'
|
||||
}
|
||||
function release {
|
||||
local tag=$1
|
||||
local name=$2
|
||||
local body=$3
|
||||
local branch=$4
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/json" \
|
||||
-H "Authorization: Bearer $GIT_TOKEN" \
|
||||
$SERVER/repos/$OWNER/$REPO/releases \
|
||||
-d '{"tag_name":"'$tag'","target_commitish":"'$branch'","name":"'$name'","body":"'$body'","draft":false,"prerelease":false,"generate_release_notes":false}'
|
||||
}
|
||||
|
||||
|
||||
. ./sheep; sheep $@
|
||||
|
||||
26
scripts/release
Executable file
26
scripts/release
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ../.env
|
||||
#source ./clog
|
||||
#source ./gitea
|
||||
|
||||
# Development Workflow
|
||||
# 1. Changes
|
||||
# 2. Commit Changes
|
||||
# N. ...
|
||||
# 4. (Maybe Squash)
|
||||
|
||||
# Releae Work Flow
|
||||
# 1. Bump Version
|
||||
# 2. Create ChangeLog
|
||||
# 3. Commit
|
||||
# 4. Tag and Push Tag
|
||||
# 5. Create Release
|
||||
|
||||
ver=$(./clog bump)
|
||||
#cl=$(log)
|
||||
|
||||
echo -e "$ver"
|
||||
#echo -e "$cl"
|
||||
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ../.env
|
||||
|
||||
npx release-please bootstrap \
|
||||
--token=$TOKEN \
|
||||
--api-url="$GIT_URL" \
|
||||
--repo-url=$OWNER/$REPO \
|
||||
--release-type=$TYPE \
|
||||
--dry-run
|
||||
|
||||
|
||||
30
scripts/sheep
Executable file
30
scripts/sheep
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# Sheep: Shepard a file full of functions.
|
||||
# Call one directly or load them as a library.
|
||||
#
|
||||
function sheep {
|
||||
if [[ "${BASH_SOURCE[1]}" != "${0}" ]]; then
|
||||
: # Do Nothing: no-op command
|
||||
else
|
||||
# Run if loaded directly.
|
||||
source ../.env
|
||||
|
||||
CALL=$1
|
||||
shift
|
||||
|
||||
# Call Method
|
||||
[[ "$(type -t $CALL)" == "function" ]] && {
|
||||
"$CALL" "$@"
|
||||
} || {
|
||||
[[ -z "$CALL" ]] && {
|
||||
echo -e "Available Functions\n"
|
||||
ret="$(declare -Fp)"
|
||||
ret="${ret//declare -f/}"
|
||||
echo "${ret//sheep/}"
|
||||
}
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user