Skip to content

Commit 744d55c

Browse files
feat: Build for release
1 parent 2beb5a8 commit 744d55c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1353
-486
lines changed

README.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release GitHub Actions
22

3-
[![Build Status](https://github.com/technote-space/release-github-actions/workflows/Build/badge.svg)](https://github.com/technote-space/release-github-actions/actions)
3+
[![CI Status](https://github.com/technote-space/release-github-actions/workflows/CI/badge.svg)](https://github.com/technote-space/release-github-actions/actions)
44
[![codecov](https://codecov.io/gh/technote-space/release-github-actions/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/release-github-actions)
55
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/release-github-actions/badge)](https://www.codefactor.io/repository/github/technote-space/release-github-actions)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/release-github-actions/blob/master/LICENSE)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release GitHub Actions
22

3-
[![Build Status](https://github.com/technote-space/release-github-actions/workflows/Build/badge.svg)](https://github.com/technote-space/release-github-actions/actions)
3+
[![CI Status](https://github.com/technote-space/release-github-actions/workflows/CI/badge.svg)](https://github.com/technote-space/release-github-actions/actions)
44
[![codecov](https://codecov.io/gh/technote-space/release-github-actions/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/release-github-actions)
55
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/release-github-actions/badge)](https://www.codefactor.io/repository/github/technote-space/release-github-actions)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/release-github-actions/blob/master/LICENSE)

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":"7fdef9deeb620f2c03b74efa631ab51eadc66b0b","ref":"refs/tags/v1.7.0","tagName":"v1.7.0","branch":"gh-actions","tags":["v1","v1.7","v1.7.0"],"updated_at":"2019-11-06T03:33:46.107Z"}
1+
{"owner":"technote-space","repo":"release-github-actions","sha":"ebb70c12ec8827a719ef90a45744285864f0edbd","ref":"refs/tags/test/v1.7.1","tagName":"test/v1.7.1","branch":"gh-actions","tags":["test/v1","test/v1.7","test/v1.7.1"],"updated_at":"2019-11-23T12:10:44.768Z"}

lib/main.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,19 @@ const github_1 = require("@actions/github");
1818
const filter_github_action_1 = require("@technote-space/filter-github-action");
1919
const github_action_helper_1 = require("@technote-space/github-action-helper");
2020
const command_1 = require("./utils/command");
21-
const misc_1 = require("./utils/misc");
2221
const constant_1 = require("./constant");
23-
const { showActionInfo } = github_action_helper_1.Utils;
2422
/**
2523
* run
2624
*/
2725
function run() {
2826
return __awaiter(this, void 0, void 0, function* () {
29-
try {
30-
const logger = new github_action_helper_1.Logger();
31-
showActionInfo(path_1.default.resolve(__dirname, '..'), logger, github_1.context);
32-
if (!filter_github_action_1.isTargetEvent(constant_1.TARGET_EVENTS, github_1.context)) {
33-
logger.info('This is not target event.');
34-
return;
35-
}
36-
const directories = misc_1.getReplaceDirectory();
37-
logger.startProcess('Replace variables');
38-
Object.keys(directories).forEach(directory => logger.info('%s: %s', directories[directory], directory));
39-
yield command_1.deploy(new github_1.GitHub(core_1.getInput('GITHUB_TOKEN', { required: true })), github_1.context);
40-
}
41-
catch (error) {
42-
core_1.setFailed(error.message);
27+
const logger = new github_action_helper_1.Logger();
28+
github_action_helper_1.ContextHelper.showActionInfo(path_1.default.resolve(__dirname, '..'), logger, github_1.context);
29+
if (!filter_github_action_1.isTargetEvent(constant_1.TARGET_EVENTS, github_1.context)) {
30+
logger.info('This is not target event.');
31+
return;
4332
}
33+
yield command_1.deploy(new github_1.GitHub(core_1.getInput('GITHUB_TOKEN', { required: true })), github_1.context);
4434
});
4535
}
46-
run();
36+
run().catch(error => core_1.setFailed(error.message));

lib/utils/command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const moment_1 = __importDefault(require("moment"));
1717
const path_1 = __importDefault(require("path"));
1818
const github_action_helper_1 = require("@technote-space/github-action-helper");
1919
const misc_1 = require("./misc");
20-
const { getRepository, getTagName } = github_action_helper_1.Utils;
20+
const { getRepository, getTagName } = github_action_helper_1.ContextHelper;
2121
exports.replaceDirectory = (message) => {
2222
const directories = misc_1.getReplaceDirectory();
2323
return Object.keys(directories).reduce((value, directory) => value.split(` -C ${directory}`).join('').split(directory).join(directories[directory]), message);
@@ -95,7 +95,7 @@ exports.push = (context) => __awaiter(void 0, void 0, void 0, function* () {
9595
yield helper.deleteTag(pushDir, tagNames, context);
9696
yield helper.fetchTags(pushDir, context);
9797
yield helper.addLocalTag(pushDir, tagNames);
98-
yield helper.push(pushDir, branchName, context);
98+
yield helper.push(pushDir, branchName, true, context);
9999
});
100100
const findRelease = (octokit, context) => __awaiter(void 0, void 0, void 0, function* () {
101101
const tagName = getTagName(context);

lib/utils/misc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ exports.getReplaceDirectory = () => {
118118
[workDir]: '<Working Directory>',
119119
};
120120
};
121-
exports.isValidContext = (context) => exports.isValidTagName(github_action_helper_1.Utils.getTagName(context));
121+
exports.isValidContext = (context) => exports.isValidTagName(github_action_helper_1.ContextHelper.getTagName(context));

0 commit comments

Comments
 (0)