Automatic release for gitlab-svg
This adds an automatic release process based on semantic-release.
With the help of @sementic-release/exec
we actually can make semantic release a bit smarter, instead of parsing the commit messages, we just check the actual changes. Every commit on master will run the following algorithm:
- Get diff from last tag to current commit.
- Check if a file in
sprite_icons
orillustrations
was:- added
- deleted
- modified
- renamed
- If no file in those folders was changed, bail. Example output (from https://gitlab.com/gitlab-org/gitlab-svgs/-/jobs/150641090)
[3:15:01 PM] [semantic-release] › ℹ Found git tag v1.47.0 associated with version 1.47.0 [3:15:01 PM] [semantic-release] › ℹ Found 5 commits since last release [3:15:01 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/exec" [3:15:01 PM] [semantic-release] [@semantic-release/exec] › ℹ Call script ./build_scripts/analyze-commits.sh v1.47.0 Checking LAST_TAG v1.47.0 against HEAD, changes: No changes [3:15:01 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/exec" [3:15:01 PM] [semantic-release] › ℹ There are no relevant changes, so no new version is released. Job succeeded
- If a file file was changed, a minor version bump will happen and a changelog is automatically generated. Example output (from https://gitlab.com/gitlab-org/gitlab-svgs/-/jobs/150633011):
[3:01:36 PM] [semantic-release] › ℹ Found git tag v1.47.0 associated with version 1.47.0 [3:01:36 PM] [semantic-release] › ℹ Found 6 commits since last release [3:01:36 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/exec" [3:01:36 PM] [semantic-release] [@semantic-release/exec] › ℹ Call script ./build_scripts/analyze-commits.sh v1.47.0 Checking LAST_TAG v1.47.0 against HEAD, changes: illustrations/feature_moved.svg sprite_icons/angle-double-doubledouble.svg sprite_icons/angle-double-left.svg sprite_icons/angle-double-right.svg sprite_icons/imoved.svg minor [3:01:36 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/exec" [3:01:36 PM] [semantic-release] › ℹ The next release version is 1.48.0 [3:01:36 PM] [semantic-release] › ℹ Start step "verifyRelease" of plugin "@semantic-release/exec" [3:01:36 PM] [semantic-release] › ✔ Completed step "verifyRelease" of plugin "@semantic-release/exec" [3:01:36 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/exec" [3:01:36 PM] [semantic-release] [@semantic-release/exec] › ℹ Call script ./build_scripts/generate-notes.sh v1.47.0 1.48.0 # [1.48.0] - Added icon 'angle-double-doubledouble' - Removed illustration 'feature_moved' - Removed icon 'angle-double-left' - Updated icon 'angle-double-right' - Renamed icon 'dumbbell' to 'imoved' [3:01:36 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/exec" [3:01:36 PM] [semantic-release] › ⚠ Skip step "prepare" of plugin "@semantic-release/exec" in dry-run mode [3:01:36 PM] [semantic-release] › ⚠ Skip step "prepare" of plugin "@semantic-release/npm" in dry-run mode [3:01:36 PM] [semantic-release] › ⚠ Skip step "prepare" of plugin "@semantic-release/git" in dry-run mode [3:01:36 PM] [semantic-release] › ⚠ Skip v1.48.0 tag creation in dry-run mode [3:01:36 PM] [semantic-release] › ⚠ Skip step "publish" of plugin "@semantic-release/exec" in dry-run mode [3:01:36 PM] [semantic-release] › ⚠ Skip step "publish" of plugin "@semantic-release/npm" in dry-run mode [3:01:36 PM] [semantic-release] › ⚠ Skip step "publish" of plugin "@semantic-release/gitlab" in dry-run mode [3:01:36 PM] [semantic-release] › ✔ Published release 1.48.0 [3:01:36 PM] [semantic-release] › ℹ Release note for version 1.48.0: # [1.48.0] * Added icon 'angle-double-doubledouble' * Removed illustration 'feature_moved' * Removed icon 'angle-double-left' * Updated icon 'angle-double-right' * Renamed icon 'dumbbell' to 'imoved' Job succeeded
Closes #11 (closed)
Edited by Lukas Eipert