Skip to content
This repository was archived by the owner on Feb 5, 2023. It is now read-only.

Commit 77059f9

Browse files
committed
chore: Enable automatic releases
1 parent b0012c1 commit 77059f9

File tree

5 files changed

+95
-42
lines changed

5 files changed

+95
-42
lines changed

.github/main.workflow

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,70 @@
11
workflow "Build, lint and test" {
22
on = "push"
3-
resolves = ["Test", "Lint"]
3+
resolves = [
4+
"Build project",
5+
"Lint project",
6+
"Test project",
7+
"Publish project"
8+
]
49
}
510

6-
action "Build" {
7-
uses = "docker://node:10"
11+
action "Don't skip CI" {
12+
uses = "ffflorian/actions/skip-ci-check@master"
13+
}
14+
15+
action "Install dependencies" {
16+
uses = "ffflorian/actions/git-node@master"
17+
needs = "Don't skip CI"
18+
runs = "yarn"
19+
}
20+
21+
action "Lint project" {
22+
uses = "ffflorian/actions/git-node@master"
23+
needs = "Install dependencies"
24+
runs = "yarn"
25+
args = "lint"
26+
}
27+
28+
action "Build project" {
29+
uses = "ffflorian/actions/git-node@master"
30+
needs = "Install dependencies"
831
runs = "yarn"
32+
args = "dist"
933
}
1034

11-
action "Test" {
12-
uses = "docker://node:10"
13-
needs = ["Build"]
35+
action "Test project" {
36+
uses = "ffflorian/actions/git-node@master"
37+
needs = "Install dependencies"
1438
runs = "yarn"
1539
args = "test"
1640
}
1741

18-
action "Lint" {
19-
uses = "docker://node:10"
20-
needs = ["Build"]
42+
action "Check for master branch" {
43+
uses = "actions/bin/filter@master"
44+
needs = [
45+
"Build project",
46+
"Lint project",
47+
"Test project"
48+
]
49+
args = "branch master"
50+
}
51+
52+
action "Don't publish dependency updates" {
53+
uses = "ffflorian/actions/last_commit@master"
54+
needs = "Check for master branch"
55+
args = "^(?!chore\\(deps)"
56+
}
57+
58+
action "Publish project" {
59+
uses = "ffflorian/actions/git-node@master"
60+
needs = "Don't publish dependency updates"
61+
env = {
62+
GIT_AUTHOR_NAME = "ffflobot"
63+
GIT_AUTHOR_EMAIL = "ffflobot@users.noreply.github.com"
64+
GIT_COMMITTER_NAME = "ffflobot"
65+
GIT_COMMITTER_EMAIL = "ffflobot@users.noreply.github.com"
66+
}
2167
runs = "yarn"
22-
args = "lint"
68+
args = "release"
69+
secrets = ["GH_TOKEN", "NPM_TOKEN"]
2370
}

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
"@semantic-release/npm",
7+
[
8+
"@semantic-release/github",
9+
{
10+
"successComment": false,
11+
"releasedLabels": false
12+
}
13+
],
14+
[
15+
"@semantic-release/git",
16+
{
17+
"assets": ["package.json", "CHANGELOG.md"],
18+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
19+
}
20+
]
21+
]
22+
}

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
"description": "Check your Rust packages for updates.",
1313
"devDependencies": {
1414
"@ffflorian/prettier-config": "0.0.3",
15+
"@ffflorian/tslint-config": "0.1.0",
16+
"@semantic-release/changelog": "3.0.2",
17+
"@semantic-release/git": "7.0.8",
1518
"@types/node": "12.0.0",
1619
"husky": "2.2.0",
1720
"lint-staged": "8.1.6",
1821
"prettier": "1.17.0",
1922
"rimraf": "2.6.3",
23+
"semantic-release": "15.13.12",
2024
"tslint": "5.16.0",
2125
"tslint-config-prettier": "1.18.0",
2226
"tslint-plugin-prettier": "2.0.1",
@@ -39,7 +43,7 @@
3943
"license": "MIT",
4044
"lint-staged": {
4145
"*.ts": [
42-
"tslint --config tslint.json --project tsconfig.json --fix",
46+
"tslint --project tsconfig.json --fix",
4347
"git add"
4448
],
4549
"*.{json,md}": [
@@ -55,10 +59,14 @@
5559
"build": "tsc",
5660
"clean": "rimraf dist",
5761
"dist": "yarn clean && yarn build",
62+
"fix": "yarn fix:other && yarn fix:ts",
63+
"fix:other": "yarn prettier --write",
64+
"fix:ts": "yarn lint:ts --fix",
5865
"lint": "yarn lint:ts && yarn lint:other",
5966
"lint:other": "yarn prettier --list-different",
6067
"lint:ts": "tslint --project tsconfig.json",
61-
"prettier": "prettier --write \"**/*.{json,md}\"",
68+
"prettier": "prettier \"*.{json,md}\"",
69+
"release": "semantic-release",
6270
"test": "exit 0"
6371
},
6472
"version": "0.2.0"

tslint.json

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
{
2-
"extends": ["tslint-config-prettier", "tslint-plugin-prettier"],
3-
"rules": {
4-
"array-type": [true, "array-simple"],
5-
"ban-comma-operator": true,
6-
"curly": true,
7-
"jsdoc-format": [true, "check-multiline-start"],
8-
"no-duplicate-imports": true,
9-
"no-duplicate-switch-case": true,
10-
"no-duplicate-variable": [true, "check-parameters"],
11-
"no-floating-promises": true,
12-
"no-invalid-template-strings": true,
13-
"no-object-literal-type-assertion": true,
14-
"no-return-await": true,
15-
"no-sparse-arrays": true,
16-
"ordered-imports": [
17-
true,
18-
{
19-
"named-imports-order": "lowercase-last"
20-
}
21-
],
22-
"no-this-assignment": true,
23-
"object-literal-sort-keys": true,
24-
"prefer-conditional-expression": true,
25-
"prefer-const": true,
26-
"prefer-object-spread": true,
27-
"prefer-readonly": true,
28-
"prefer-template": true,
29-
"prettier": true,
30-
"space-within-parens": [true, 0]
31-
},
2+
"extends": ["@ffflorian/tslint-config"],
323
"linterOptions": {
334
"exclude": ["dist/**", "node_modules/**"]
345
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
resolved "https://registry.npmjs.org/@ffflorian/prettier-config/-/prettier-config-0.0.3.tgz#87be879c8d1d47ca698e9ce7d2be9af6b85ec917"
3939
integrity sha512-EhlT3il2bb3GfTEDKxbmOjUpqzAJTc8ncRR4zJ2D2WtXyQiKqw/mINTVZFLh0MfAfFcc3TbLhfY2aHPnnxnvDw==
4040

41+
"@ffflorian/tslint-config@0.1.0":
42+
version "0.1.0"
43+
resolved "https://registry.yarnpkg.com/@ffflorian/tslint-config/-/tslint-config-0.1.0.tgz#e6ccff8d7e928a6f55236c224af25f97dd70c9a7"
44+
integrity sha512-7FgMxxQeMpG2BynLzMuqMjh7W2a3fP/cIg42kkCA63X6VhQTYbdDjFFBkjfOeivx7xus/1Qb7+fevvoXo9DDlw==
45+
4146
"@samverschueren/stream-to-observable@^0.3.0":
4247
version "0.3.0"
4348
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"

0 commit comments

Comments
 (0)