Skip to content

Commit

Permalink
feat(release): support app-hub publish
Browse files Browse the repository at this point in the history
  • Loading branch information
varl committed Jun 28, 2021
1 parent ec679e9 commit 615d783
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
"license": "BSD-3-Clause",
"private": false,
"dependencies": {
"@dhis2/cli-app-scripts": "^7.0.0",
"@dhis2/cli-helpers-engine": "^3.0.0",
"@dhis2/cli-utils-codemods": "^3.0.0",
"@dhis2/cli-utils-cypress": "^8.0.0",
"@dhis2/cli-utils-docsite": "^3.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.5",
"@semantic-release/npm": "^7.0.5",
Expand Down
31 changes: 31 additions & 0 deletions packages/utils/src/cmds/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,37 @@ function publisher(target = '', packages) {
})
}

case 'app-hub': {
return packages
.map(pkgJsonPath => {
return [
[
'@semantic-release/npm',
{
pkgRoot: path.dirname(pkgJsonPath),
npmPublish: false,
},
],
[
'@semantic-release/exec',
{
verifyConditionsCmd:
'[ -f ' +
path.join(
path.dirname(pkgJsonPath),
'd2.config.js'
) +
' ] || exit 1',
publishCmd:
'npx --no-install d2-app-scripts publish --cwd ' +
path.dirname(pkgJsonPath),
},
],
]
})
.reduce((a, b) => a.concat(b))
}

default: {
return packages.map(pkgJsonPath => {
return [
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4494,6 +4494,18 @@
version "2.2.0"
resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-2.2.0.tgz#ee9d5a09c9969eade1ec864776aeda5c5cddbbf0"

"@semantic-release/exec@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@semantic-release/exec/-/exec-5.0.0.tgz#69c253107a755dabf7c262d417269d099f714356"
integrity sha512-t7LWXIvDJQbuGCy2WmMG51WyaGSLTvZBv9INvcI4S0kn+QjnnVVUMhcioIqhb0r3yqqarMzHVcABFug0q0OXjw==
dependencies:
"@semantic-release/error" "^2.1.0"
aggregate-error "^3.0.0"
debug "^4.0.0"
execa "^4.0.0"
lodash "^4.17.4"
parse-json "^5.0.0"

"@semantic-release/git@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-9.0.0.tgz#304c4883c87d095b1faaae93300f1f1e0466e9a5"
Expand Down

0 comments on commit 615d783

Please sign in to comment.