1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-04-18 04:44:01 +03:00

ci: add release workflow via git-sv (#18)

This commit is contained in:
Patrick Schratz 2025-01-18 10:20:10 +01:00 committed by GitHub
parent 73b4abdcd7
commit 295b5b87b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 122 additions and 0 deletions

25
.crow/changelog.yaml Normal file
View File

@ -0,0 +1,25 @@
clone:
git:
image: docker.io/thegeeklab/wp-git-clone:latest
when:
event: [push, manual]
branch: ${CI_REPO_DEFAULT_BRANCH}
steps:
- name: 'Upcoming Changelog'
environment:
GITHUB_TOKEN:
from_secret: GITHUB_PKGS_TOKEN
image: docker.io/thegeeklab/git-sv:1.0.9
commands: |
apk add -q --no-cache jq github-cli
export RELEASE_NOTES=$(git sv rn)
export ISSUE_NUMBER=$(gh issue list --json number --state open --label "changelog" | jq -r '.[] | .number')
if [ -z "$ISSUE_NUMBER" ]; then
gh issue create --title "Changelog for next version" --body "$RELEASE_NOTES"
else
gh issue edit $ISSUE_NUMBER --title "Changelog for next version" --body "$RELEASE_NOTES"
fi

40
.crow/release.yaml Normal file
View File

@ -0,0 +1,40 @@
when:
- event: tag
clone:
git:
image: docker.io/woodpeckerci/plugin-git:2.6.0
settings:
tags: true
depends_on:
- docker
steps:
changelog:
image: docker.io/thegeeklab/git-sv:1.0.9
commands:
- git sv current-version
- git sv release-notes -t ${CI_COMMIT_TAG:-dev} -o CHANGELOG.md
- cat CHANGELOG.md
create_release:
image: 'alpine:3.21'
environment:
GITHUB_TOKEN:
from_secret: GITHUB_PKGS_TOKEN
commands:
- apk add -q --no-cache github-cli
- gh release create ${CI_COMMIT_TAG} --title "Crow CI ${CI_COMMIT_TAG}" --notes-file CHANGELOG.md
when:
event: [tag]
branch: ${CI_REPO_DEFAULT_BRANCH}
backend_options:
kubernetes:
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 300Mi
cpu: 1000m

57
.gitsv/config.yaml Normal file
View File

@ -0,0 +1,57 @@
version: '1.1' # Configuration version.
versioning:
update-major: [breaking] # Commit types used to bump major.
update-minor: [feat, perf] # Commit types used to bump minor.
update-patch: [build, ci, chore, fix, perf, refactor, test] # Commit types used to bump patch.
# When type is not present on update rules and is unknown (not mapped on commit message types);
# if ignore-unknown=false bump patch, if ignore-unknown=true do not bump version.
ignore-unknown: false
tag:
pattern: 'v%d.%d.%d' # Pattern used to create git tag.
filter: '' # Enables you to filter for considerable tags using git pattern syntax.
release-notes:
sections: # Array with each section of release note. Check template section for more information.
- name: Breaking Changes
section-type: breaking-changes
- name: Features # Name used on section.
section-type: commits # Type of the section, supported types: commits, breaking-changes.
commit-types: [feat, perf] # Commit types for commit section-type, one commit type cannot be in more than one section.
- name: Bug Fixes
section-type: commits
commit-types: [fix]
- name: Maintenance
section-type: commits
commit-types: [chore, refactor]
- name: Documentation
commit-types: [docs]
section-type: commits
- name: CI
commit-types: [ci]
section-type: commits
branches: # Git branches config.
prefix: ([a-z]+\/)? # Prefix used on branch name, it should be a regex group.
suffix: (-.*)? # Suffix used on branch name, it should be a regex group.
disable-issue: false # Set true if there is no need to recover issue id from branch name.
skip: [] # List of branch names ignored on commit message validation.
skip-detached: false # Set true if a detached branch should be ignored on commit message validation.
commit-message:
# Supported commit types.
types: [build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test]
header-selector: '' # You can put in a regex here to select only a certain part of the commit message. Please define a regex group 'header'.
scope:
# Define supported scopes, if blank, scope will not be validated, if not, only scope listed will be valid.
# Don't forget to add "" on your list if you need to define scopes and keep it optional.
values: []
footer:
issue: # Use "issue: {}" if you wish to disable issue footer.
key: jira # Name used to define an issue on footer metadata.
key-synonyms: [Jira, JIRA] # Supported variations for footer metadata.
use-hash: false # If false, use :<space> separator. If true, use <space># separator.
add-value-prefix: '' # Add a prefix to issue value.
issue:
regex: '[A-Z]+-[0-9]+' # Regex for issue id.