forked from karma-runner/karma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update documentation after publishing a release (karma-runner#3526)
- Loading branch information
1 parent
e2b805e
commit 49ac26f
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
tmp | ||
test | ||
tasks | ||
/tools/ | ||
docs | ||
client | ||
logo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { execSync } = require('child_process') | ||
const { dirSync } = require('tmp') | ||
|
||
const success = async (pluginConfig, { nextRelease, logger }) => { | ||
const [major, minor] = nextRelease.version.split('.') | ||
const docsVersion = `${major}.${minor}` | ||
|
||
const { name: docsPath } = dirSync() | ||
|
||
// This is a regular repository remote one would get if they click a Clone | ||
// button on GitHub. The only added part is GH_TOKEN value in the `userinfo` | ||
// part of the URL (https://en.wikipedia.org/wiki/URL), which allows GitHub | ||
// to authenticate a user and authorise the push to the repository. | ||
const repoOrigin = `https://${process.env.GH_TOKEN}@github.com/karma/karma-runner.git.luolix.top.git` | ||
|
||
const options = { encoding: 'utf8', cwd: docsPath } | ||
|
||
logger.log(execSync(`git clone ${repoOrigin} .`, options)) | ||
logger.log(execSync('npm ci', options)) | ||
logger.log(execSync(`./sync-docs.sh "${nextRelease.gitTag}" "${docsVersion}"`, options)) | ||
logger.log(execSync('git push origin master', options)) | ||
} | ||
|
||
module.exports = { success } |