Skip to content

Commit 1908eec

Browse files
authored
Merge pull request #20 from icelam/develop
Merge branch 'develop' to master
2 parents 733db5e + e378c46 commit 1908eec

File tree

8 files changed

+68
-5
lines changed

8 files changed

+68
-5
lines changed

.eslintrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,15 @@
3636
"ts": "never",
3737
}
3838
]
39-
}
39+
},
40+
"overrides": [
41+
{
42+
"files": ["scripts/*.js"],
43+
"env": { "node": true },
44+
"rules": {
45+
"@typescript-eslint/no-var-requires": ["off"],
46+
"no-console": ["off"]
47+
}
48+
}
49+
]
4050
}

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ updates:
88
directory: "/"
99
schedule:
1010
interval: "daily"
11+
target-branch: "develop"
1112
labels:
1213
- "dependencies"
1314
commit-message:

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Create release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
release:
9+
name: Create release
10+
runs-on: ubuntu-18.04
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@master
15+
- name: Setup Node.js version
16+
uses: actions/setup-node@master
17+
with:
18+
node-version: '12.16.1'
19+
20+
- name: Generate release body
21+
run: |
22+
yarn extract-latest-change-log
23+
- name: Create release
24+
id: create-release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: ${{ github.ref }}
30+
release_name: ${{ github.ref }}
31+
draft: false
32+
prerelease: false
33+
body_path: RELEASE_BODY.md

.versionrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"header": "# Changelog\n"
3+
}

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4-
53
### [1.0.1](https://github.com/icelam/html-inline-script-webpack-plugin/compare/v1.0.0...v1.0.1) (2021-01-22)
64

75

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
[![Latest version](https://img.shields.io/github/v/release/icelam/html-inline-script-webpack-plugin.svg?sort=semver&label=latest)](https://github.com/icelam/html-inline-script-webpack-plugin/releases)
44
[![Download count](https://img.shields.io/npm/dm/html-inline-script-webpack-plugin)](https://www.npmjs.com/package/html-inline-script-webpack-plugin)
55
[![Install size](https://packagephobia.com/badge?p=html-inline-script-webpack-plugin)](https://packagephobia.com/result?p=html-inline-script-webpack-plugin)
6-
<!--[![Package quality](https://npm.packagequality.com/shield/html-inline-script-webpack-plugin.svg)](https://packagequality.com/#?package=html-inline-script-webpack-plugin)-->
6+
![Build test](https://github.com/icelam/html-inline-script-webpack-plugin/workflows/Build%20test/badge.svg)
7+
[![Package quality](https://npm.packagequality.com/shield/html-inline-script-webpack-plugin.svg)](https://packagequality.com/#?package=html-inline-script-webpack-plugin)
78

89
A webpack plugin for converting external script files `<script src="app.js"></script>` to inline script block `<script>...</script>`. Requires [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) to work.
910

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"lint": "eslint --ext .ts,js src",
99
"prepare": "install-peers",
1010
"first-release": "npx standard-version --commit-all --tag-prefix v --first-release",
11-
"release": "npx standard-version --commit-all --tag-prefix v"
11+
"release": "npx standard-version --commit-all --tag-prefix v",
12+
"extract-latest-change-log": "node scripts/extractLatestChangeLog.js"
1213
},
1314
"author": "Ice Lam",
1415
"repository": {

scripts/extractLatestChangeLog.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const fs = require('fs').promises;
2+
const path = require('path');
3+
4+
const BASE_DIR = path.join(__dirname, '..');
5+
const CHANGELOG_PATH = path.join(BASE_DIR, 'CHANGELOG.md');
6+
const RELEASE_BODY_PATH = path.join(BASE_DIR, 'RELEASE_BODY.md');
7+
8+
(async () => {
9+
try {
10+
const file = await fs.readFile(CHANGELOG_PATH, 'utf8');
11+
const updated = /(#+ \[\d+\.\d+\.\d+].*?)#+ \[?\d+\.\d+\.\d+]?/s.exec(file);
12+
await fs.writeFile(RELEASE_BODY_PATH, updated[1]);
13+
} catch (error) {
14+
console.error(error);
15+
}
16+
})();

0 commit comments

Comments
 (0)