Skip to content

Commit

Permalink
fix: fix release pipeline for missing versions update
Browse files Browse the repository at this point in the history
  • Loading branch information
dylannnn committed May 6, 2024
1 parent 4b86378 commit 075370d
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .compodocrc.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
output: ./dist/compodoc
name: NgxMultiKeywordsHighlighter Documentation
version: 2.1.1
# Configurations: https://compodoc.app/guides/options.html
tsconfig: tsconfig.doc.json
theme: material
version: 1.3.0
# language: en-US
customFavicon: tools/assets/favicon.ico
customLogo: tools/assets/logo-light.svg
hideGenerator: true
disablePrivate: true
disableInternal: true
# disableCoverage: true
output: ./dist/compodoc
unitTestCoverage: ./dist/coverage/libs/ngx-multi-keywords-highlighter/coverage-summary.json
4 changes: 1 addition & 3 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
default: true

MD013: false
MD024:
allow_different_nesting: true
MD013: false
2 changes: 1 addition & 1 deletion libs/ngx-multi-keywords-highlighter/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"prefix": "mkh",
"targets": {
"copy:docs": {
"command": "cp README.md CHANGELOG.md LICENSE dist/libs/ngx-multi-keywords-highlighter/",
"command": "cp README.md LICENSE dist/libs/ngx-multi-keywords-highlighter/",
"options": {
"cwd": "{workspaceRoot}"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '1.3.0';
export const version = '2.1.1';
117 changes: 115 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mkh",
"version": "2.1.0-development",
"version": "2.1.1",
"license": "MIT",
"author": "Yunfei Li <dylannnnlee@gmail.com> (https://yunfei.li)",
"homepage": "https://github.com/dylannnn/ngx-multi-keywords-highlighter#readme",
Expand Down Expand Up @@ -111,6 +111,7 @@
"@playwright/test": "^1.43.1",
"@schematics/angular": "^17.3.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@storybook/addon-a11y": "^8.0.9",
"@storybook/addon-actions": "^8.0.9",
Expand Down
6 changes: 6 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ module.exports = {
pkgRoot: 'dist/libs/ngx-multi-keywords-highlighter'
}
],
[
'@semantic-release/exec',
{
"verifyReleaseCmd": "bash tools/semantic-release/update-version.sh ${lastRelease.version} ${nextRelease.version}",
}
],
'@semantic-release/github',
[
'@semantic-release/git',
Expand Down
17 changes: 17 additions & 0 deletions tools/semantic-release/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

LAST_RELEASE_VERSION=$1
NEXT_RELEASE_VERSION=$2

# Update lib version
sed -i '' "s/$LAST_RELEASE_VERSION/$NEXT_RELEASE_VERSION/g" libs/ngx-multi-keywords-highlighter/src/lib/core/version.ts

# Update package.json and package-lock.json version
PACKAGE_JSON_FILE="package.json"
PACKAGE_LOCK_JSON_FILE="package-lock.json"

jq --arg NEXT_RELEASE_VERSION "$NEXT_RELEASE_VERSION" '.version = $NEXT_RELEASE_VERSION' "$PACKAGE_JSON_FILE" > "tmp-package.json" && mv "tmp-package.json" "$PACKAGE_JSON_FILE"
jq --arg NEXT_RELEASE_VERSION "$NEXT_RELEASE_VERSION" '.packages."".version = $NEXT_RELEASE_VERSION | .version = $NEXT_RELEASE_VERSION' "$PACKAGE_LOCK_JSON_FILE" > "tmp-package-lock.json" && mv "tmp-package-lock.json" "$PACKAGE_LOCK_JSON_FILE"

# Update compodoc version
sed -i '' "s/$LAST_RELEASE_VERSION/$NEXT_RELEASE_VERSION/g" .compodocrc.yaml

0 comments on commit 075370d

Please sign in to comment.