Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
ci: update version number replacement script
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtrank committed Jun 3, 2020
1 parent 9939b59 commit a982691
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 48 deletions.
11 changes: 11 additions & 0 deletions .release-prep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
if [ -n "$1" ]
then
npx replace-in-file "/Version: (.*)/g" "Version: $1" style.css --isRegex
npx json -f package.json -I -e "this.version = '$1'"
npx json -f package-lock.json -I -e "this.version = '$1'"
zip -r ../robot-rock.zip . [email protected]
exit 0
else
exit 1
fi
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"changelogFile": "CHANGELOG.md",
}],
['@semantic-release/exec', {
"prepareCmd": "npx replace-in-file ${lastRelease.version} ${nextRelease.version} style.css,package.json,package-lock.json && zip -r ../robot-rock.zip . [email protected]"
"prepareCmd": "sh ./release-prep.sh ${nextRelease.version}"
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "style.css", "package.json", "package-lock.json"],
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

93 changes: 48 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
{
"name": "robot-rock",
"version": "1.2.0-beta.1",
"description": "Example WordPress theme to test automatic updates with Github releases.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kurtrank/robot-rock.git"
},
"author": "Kurt Rank",
"license": "MIT",
"bugs": {
"url": "https://github.com/kurtrank/robot-rock/issues"
},
"homepage": "https://github.com/kurtrank/robot-rock#readme",
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"commitizen": "^4.0.3",
"cz-conventional-changelog": "^3.1.0",
"husky": "^4.2.3",
"replace-in-file": "^5.0.2",
"semantic-release": "^17.0.4"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"prepare-commit-msg": "[ $IS_CI ] || exec < /dev/tty && git cz --hook || true",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
"name": "robot-rock",
"version": "1.2.0",
"description": "Example WordPress theme to test automatic updates with Github releases.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kurtrank/robot-rock.git"
},
"author": "Kurt Rank",
"license": "MIT",
"bugs": {
"url": "https://github.com/kurtrank/robot-rock/issues"
},
"homepage": "https://github.com/kurtrank/robot-rock#readme",
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"commitizen": "^4.0.3",
"cz-conventional-changelog": "^3.1.0",
"husky": "^4.2.3",
"replace-in-file": "^5.0.2",
"semantic-release": "^17.0.4"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"prepare-commit-msg": "[ $IS_CI ] || exec < /dev/tty && git cz --hook || true",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"json": "^9.0.6"
}
}
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************
Theme Name: Robot Rock
Text Domain: robot-rock
Version: 1.2.0-beta.1
Version: 1.2.0
Theme URI: https://github.com/kurtrank/robot-rock
GitHub Theme URI: kurtrank/robot-rock
Release Asset: true
Expand Down

0 comments on commit a982691

Please sign in to comment.