This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: adds source code releasing (#51)
* ci: added vendir sync for common tasks * ci: make bump pr update appVersion * ci: add release job * fix: remove yamls from being pettier checked, fixes action/check-code
- Loading branch information
1 parent
ac236fa
commit 7db0e7f
Showing
8 changed files
with
281 additions
and
43 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 |
---|---|---|
|
@@ -6,3 +6,6 @@ build/ | |
coverage/ | ||
.vscode | ||
.gvars.json | ||
|
||
**/*.yaml | ||
**/*.yml |
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,54 @@ | ||
# configuration file for git-cliff (0.1.0) | ||
|
||
[changelog] | ||
# changelog header | ||
header = """""" | ||
|
||
# template for the changelog body | ||
# https://tera.netlify.app/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
# remove the leading and trailing whitespaces from the template | ||
trim = true | ||
# changelog footer | ||
footer = """""" | ||
|
||
[git] | ||
# parse the commits based on https://www.conventionalcommits.org | ||
conventional_commits = true | ||
# filter out the commits that are not conventional | ||
filter_unconventional = true | ||
# regex for parsing and grouping commits | ||
commit_parsers = [ | ||
{ message = "^feat", group = "Features"}, | ||
{ message = "^fix", group = "Bug Fixes"}, | ||
{ message = "^doc", group = "Documentation"}, | ||
{ message = "^perf", group = "Performance"}, | ||
{ message = "^refactor", group = "Refactor"}, | ||
{ message = "^style", group = "Styling"}, | ||
{ message = "^test", group = "Testing"}, | ||
{ message = "^chore\\(release\\): prepare for", skip = true}, | ||
{ message = "^chore", group = "Miscellaneous Tasks"}, | ||
{ body = ".*security", group = "Security"}, | ||
] | ||
# filter out the commits that are not matched by commit parsers | ||
filter_commits = true | ||
# glob pattern for matching git tags | ||
tag_pattern = "v[0-9]*" | ||
# regex for skipping tags | ||
skip_tags = "v0.1.0-beta.1" | ||
# regex for ignoring tags | ||
ignore_tags = "" | ||
# sort the tags topologically | ||
topo_order = false | ||
# sort the commits inside sections by oldest/newest order | ||
sort_commits = "newest" |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
# ------------ CHANGELOG ------------ | ||
|
||
pushd repo | ||
|
||
# First time | ||
if [[ $(cat ../version/version) == "0.0.0" ]]; then | ||
git cliff --config ../pipeline-tasks/ci/config/vendor/git-cliff.toml > ../artifacts/gh-release-notes.md | ||
|
||
# Fetch changelog from last ref | ||
else | ||
export prev_ref=$(git rev-list -n 1 $(cat ../version/version)) | ||
export new_ref=$(git rev-parse HEAD) | ||
|
||
git cliff --config ../pipeline-tasks/ci/config/vendor/git-cliff.toml $prev_ref..$new_ref > ../artifacts/gh-release-notes.md | ||
fi | ||
|
||
popd | ||
|
||
# Generate Changelog | ||
echo "CHANGELOG:" | ||
echo "-------------------------------" | ||
cat artifacts/gh-release-notes.md | ||
echo "-------------------------------" | ||
|
||
# ------------ BUMP VERSION ------------ | ||
|
||
echo -n "Prev Version: " | ||
cat version/version | ||
echo "" | ||
|
||
# Initial Version | ||
if [[ $(cat version/version) == "0.0.0" ]]; then | ||
echo "0.1.0" > version/version | ||
# Figure out proper version to release | ||
elif [[ $(cat artifacts/gh-release-notes.md | grep breaking) != '' ]] || [[ $(cat artifacts/gh-release-notes.md | grep feature) != '' ]]; then | ||
echo "Breaking change / Feature Addition found, bumping minor version..." | ||
bump2version minor --current-version $(cat version/version) --allow-dirty version/version | ||
else | ||
echo "Only patches and fixes found - no breaking changes, bumping patch version..." | ||
bump2version patch --current-version $(cat version/version) --allow-dirty version/version | ||
fi | ||
|
||
echo -n "Release Version: " | ||
cat version/version | ||
echo "" | ||
|
||
# ------------ ARTIFACTS ------------ | ||
|
||
cat version/version > artifacts/gh-release-tag | ||
echo "v$(cat version/version) Release" > artifacts/gh-release-name |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: vendir.k14s.io/v1alpha1 | ||
directories: | ||
- contents: | ||
- git: | ||
commitTitle: 'fix: git cliff config should be pulled from pipeline-tasks (#4)' | ||
sha: fc36c9834e4da8374728298ffd362b7bc1280bc5 | ||
path: . | ||
path: tasks/vendor | ||
- contents: | ||
- git: | ||
commitTitle: 'fix: git cliff config should be pulled from pipeline-tasks (#4)' | ||
sha: fc36c9834e4da8374728298ffd362b7bc1280bc5 | ||
path: . | ||
path: config/vendor | ||
kind: LockConfig |
Oops, something went wrong.