-
Notifications
You must be signed in to change notification settings - Fork 60k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
2,500 additions
and
56 deletions.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env node | ||
|
||
import { readFileSync, writeFileSync } from 'node:fs'; | ||
import process from 'node:process'; | ||
|
||
const tag = process.argv[2].replace('v', ''); | ||
const log = readFileSync('./CHANGELOG.md', { encoding: 'utf-8' }).split('\n'); | ||
let result = ''; | ||
let inScope = false; | ||
const regex = new RegExp(`^#+ \\[${tag}`); | ||
for (let i = 0; i < log.length; i++) { | ||
if (regex.test(log[i])) { | ||
inScope = true; | ||
result += log[i]; | ||
continue; | ||
} | ||
if (inScope && /^#+ \[/.test(log[i])) { | ||
inScope = false; | ||
break; | ||
} | ||
if (inScope) { | ||
result += `\n${log[i]}`; | ||
} | ||
} | ||
writeFileSync(`notes-v${tag}.md`, result); |
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,37 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Create Release | ||
|
||
# https://docs.github.com/en/actions/learn-github-actions/contexts#env-context | ||
env: | ||
RELEASE_VERSION: '' | ||
|
||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Get the release version from the tag | ||
shell: bash | ||
if: env.RELEASE_VERSION == '' | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- name: Generate Release Notes | ||
run: | | ||
./.github/workflows/release-notes.js ${{ env.RELEASE_VERSION }} | ||
cat notes-${{ env.RELEASE_VERSION }}.md | ||
- name: Create Release for Tag | ||
id: release_tag | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
body_path: notes-${{ env.RELEASE_VERSION }}.md |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,10 @@ | ||
import { defineConfig } from 'bumpp'; | ||
|
||
export default defineConfig({ | ||
files: [ | ||
'package.json', | ||
], | ||
all: true, | ||
recursive: true, | ||
execute: 'node scripts/release.js', | ||
}); |
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,16 @@ | ||
/** | ||
* https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type | ||
*/ | ||
export default { | ||
'extends': ['@commitlint/config-conventional'], | ||
'rules': { | ||
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore', 'revert', 'release', 'build', 'ci']], | ||
}, | ||
'type-case': [0], | ||
'type-empty': [0], | ||
'scope-empty': [0], | ||
'scope-case': [0], | ||
'subject-full-stop': [0, 'never'], | ||
'subject-case': [0, 'never'], | ||
'header-max-length': [0, 'always', 72], | ||
}; |
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
Oops, something went wrong.