Skip to content

Commit 7a1aed4

Browse files
feat: Build for release
1 parent 2fb9bef commit 7a1aed4

File tree

11 files changed

+61
-52
lines changed

11 files changed

+61
-52
lines changed

README.ja.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- [インストール](#%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB)
2323
- [オプション](#%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3)
2424
- [BUILD_COMMAND](#build_command)
25-
- [DELETE_TARGETS](#delete_targets)
25+
- [CLEAN_TARGETS](#clean_targets)
2626
- [PACKAGE_MANAGER](#package_manager)
2727
- [COMMIT_MESSAGE](#commit_message)
2828
- [COMMIT_NAME](#commit_name)
@@ -87,17 +87,16 @@ default: `''`
8787
[More details of execute command](#execute-commands)
8888
8989
### CLEAN_TARGETS
90-
[More details of execute command](#execute-commands)
9190
リリース前に掃除するファイルやディレクトリ (カンマ区切り)
9291
default: `.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,_config.yml`
9392
絶対パスや `..` は使用できません。
93+
[More details of execute command](#execute-commands)
9494

9595
### PACKAGE_MANAGER
9696
依存関係のインストールに使用するパッケージマネージャー
9797
`yarn.lock` や `package-lock.json` がある場合は自動で使用するパッケージマネージャーを決定しますが、このオプションで強制することができます。
9898
(`npm` または `yarn`)
9999
default: `''`
100-
例:`npm`
101100

102101
### COMMIT_MESSAGE
103102
コミット時に設定するメッセージ

build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"owner":"technote-space","repo":"release-github-actions","sha":"56f9dad9b3fb9a69c40f8a34f43bf83f54e05064","ref":"refs/tags/test/v2.0.0.1","tagName":"test/v2.0.0.1","branch":"gh-actions","tags":["test/v2","test/v2.0","test/v2.0.0","test/v2.0.0.1"],"updated_at":"2019-12-09T12:51:08.729Z"}
1+
{"owner":"technote-space","repo":"release-github-actions","sha":"f36c2cbac5f0a0875699636d7ea3b1929b06147d","ref":"refs/tags/test/v2.0.0.2","tagName":"test/v2.0.0.2","branch":"gh-actions","tags":["test/v2","test/v2.0","test/v2.0.0","test/v2.0.0.2"],"updated_at":"2019-12-09T15:46:15.221Z"}

lib/utils/command.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,26 @@ exports.config = () => __awaiter(void 0, void 0, void 0, function* () {
8181
yield helper.config(pushDir, name, email);
8282
});
8383
exports.commit = () => __awaiter(void 0, void 0, void 0, function* () { return helper.commit(misc_1.getParams().pushDir, misc_1.getCommitMessage()); });
84-
exports.getDeleteTestTag = (tagName, prefix) => __awaiter(void 0, void 0, void 0, function* () {
84+
exports.getDeleteTestTag = (tagName, prefix = '') => __awaiter(void 0, void 0, void 0, function* () {
8585
return (yield helper.getTags(misc_1.getParams().pushDir))
8686
.filter(tag => misc_1.isTestTag(tag))
8787
.map(tag => misc_1.getTestTag(tag))
8888
.filter(tag => versionCompare(tag, tagName, false) < 0) // eslint-disable-line no-magic-numbers
89-
.map(tag => `${prefix}${tag}`);
89+
.map(tag => `${prefix}${misc_1.getTestTagPrefix()}${tag}`);
90+
});
91+
exports.deleteTestTags = (context) => __awaiter(void 0, void 0, void 0, function* () {
92+
const tagName = getTagName(context);
93+
const { pushDir } = misc_1.getParams();
94+
if (!misc_1.isTestTag(tagName) && misc_1.isEnabledCleanTestTag()) {
95+
const prefixForTestTag = misc_1.getTestTagPrefix();
96+
if (prefixForTestTag) {
97+
yield helper.deleteTag(pushDir, yield exports.getDeleteTestTag(tagName), context);
98+
const prefixForOriginalTag = misc_1.getOriginalTagPrefix();
99+
if (prefixForOriginalTag) {
100+
yield helper.deleteTag(pushDir, yield exports.getDeleteTestTag(tagName, prefixForOriginalTag), context);
101+
}
102+
}
103+
}
90104
});
91105
exports.push = (context) => __awaiter(void 0, void 0, void 0, function* () {
92106
const { pushDir, branchName } = misc_1.getParams();
@@ -98,13 +112,8 @@ exports.push = (context) => __awaiter(void 0, void 0, void 0, function* () {
98112
yield helper.fetchTags(pushDir, context);
99113
yield helper.copyTag(pushDir, originalTag, tagName, context);
100114
}
101-
if (!misc_1.isTestTag(tagName) && misc_1.isCleanTestTag()) {
102-
const prefixForTestTag = misc_1.getTestTagPrefix();
103-
if (prefixForTestTag) {
104-
yield helper.deleteTag(pushDir, yield exports.getDeleteTestTag(tagName, prefixForTestTag), context);
105-
}
106-
}
107115
const tagNames = misc_1.getCreateTags(tagName);
116+
yield exports.deleteTestTags(context);
108117
yield helper.deleteTag(pushDir, tagNames, context);
109118
yield helper.fetchTags(pushDir, context);
110119
yield helper.addLocalTag(pushDir, tagNames);

lib/utils/misc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ exports.getOriginalTagPrefix = () => core_1.getInput('ORIGINAL_TAG_PREFIX') || c
9797
exports.isCreateMajorVersionTag = () => getBoolValue(core_1.getInput('CREATE_MAJOR_VERSION_TAG') || 'true');
9898
exports.isCreateMinorVersionTag = () => getBoolValue(core_1.getInput('CREATE_MINOR_VERSION_TAG') || 'true');
9999
exports.isCreatePatchVersionTag = () => getBoolValue(core_1.getInput('CREATE_PATCH_VERSION_TAG') || 'true');
100-
exports.isCleanTestTag = () => getBoolValue(core_1.getInput('CLEAN_TEST_TAG'));
100+
exports.isEnabledCleanTestTag = () => getBoolValue(core_1.getInput('CLEAN_TEST_TAG'));
101101
exports.getOutputBuildInfoFilename = () => {
102102
const filename = (core_1.getInput('OUTPUT_BUILD_INFO_FILENAME') || constant_1.DEFAULT_OUTPUT_BUILD_INFO_FILENAME).trim();
103103
if (filename.startsWith('/') || filename.includes('..')) {

node_modules/.yarn-integrity

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@technote-space/github-action-helper/dist/git-helper.d.ts

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@technote-space/github-action-helper/dist/git-helper.js

Lines changed: 11 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@technote-space/github-action-helper/package.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@types/node/child_process.d.ts

Lines changed: 17 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)