Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Aug 27, 2022
2 parents cb505c5 + 683e4a5 commit 5e0ec74
Show file tree
Hide file tree
Showing 32 changed files with 17,894 additions and 24,292 deletions.
82 changes: 57 additions & 25 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,72 @@ steps:
- build
commands:
- npm run test
- name: prepare release
image: node
commands:
- npm install @stdlib/utils-escape-regexp-string --no-save
- node -e "console.log(require('@stdlib/utils-escape-regexp-string')('${DRONE_TAG}'))" > .tagName.txt
- export TagName=$$(cat .tagName.txt)
- echo "/^## \(.* \($${TagName}\|\[$${TagName}\]\)\)\$/" > .tagHeading.txt
when:
event:
- tag
- name: check release prerequisites
image: node
depends_on:
- prepare release
environment:
NPM_TOKEN:
from_secret: npm_token
GITHUB_PACKAGE_TOKEN:
from_secret: github_packages_token
GITHUB_PUBLISH_TOKEN:
from_secret: github_publish_token
commands:
- npm i --no-save @octokit/rest
- >
testNPM() {
echo "//registry.npmjs.org/:_authToken=$1" > ~/.npmrc
npm whoami > /dev/null 2>&1
}
- >
testGitHub() {
node -e 'new (require("@octokit/rest").Octokit)({ auth: "'"$1"'" }).request("GET /user").catch(() => process.exit(1))' > /dev/null 2>&1
}
- export TagHeading=$$(cat .tagHeading.txt)
- '[ ! -z "$$(sed "$${TagHeading}p;d" CHANGELOG.md)" ] || { echo "No Changelog Entries Found!" && false; }'
- testNPM $NPM_TOKEN || { echo "The NPM Access Token is invalid!" && false; }
- testGitHub $GITHUB_PACKAGE_TOKEN || { echo "The GitHub Package Token is invalid!" && false; }
- testGitHub $GITHUB_PUBLISH_TOKEN || { echo "The GitHub Publish Token is invalid!" && false; }
when:
event:
- tag
- name: create package
image: node
depends_on:
- lint
- test
- check release prerequisites
commands:
- npm pack --workspaces
when:
event:
- tag
- name: prepare release notes
image: alpine
depends_on:
- check release prerequisites
commands:
- export TagName=$$(cat .tagName.txt)
- export TagHeading=$$(cat .tagHeading.txt)
- export HeadingPattern='/## \(.* \(v[0-9.]*\|\[.*\]\)\)/'
- cp -f CHANGELOG.md .releaseNotes.md
- sed -i "1,$${TagHeading}{ $${TagHeading}P ; d } ; $${HeadingPattern},\$d" .releaseNotes.md
- cp -f .releaseNotes.md .releaseTitle.md
- sed -i "2,\$d ; s$${HeadingPattern}\\\\1/" .releaseTitle.md
when:
event:
- tag
- name: publish package to npm
image: node
depends_on:
Expand Down Expand Up @@ -66,34 +122,10 @@ steps:
- tag
ref:
- refs/tags/v[0-9]*.[0-9]*.[0-9]*
- name: prepare release
image: node
depends_on:
- create package
commands:
- npm install @stdlib/utils-escape-regexp-string --no-save
- node -e "console.log(require('@stdlib/utils-escape-regexp-string')('${DRONE_TAG}'))" > .tagName.txt
when:
event:
- tag
- name: prepare release notes
image: alpine
depends_on:
- prepare release
commands:
- export TagName=$$(cat .tagName.txt)
- export TagHeading="/## \(.* \($${TagName}\|\[$${TagName}\]\)\)\$/"
- export HeadingPattern='/## \(.* \(v[0-9.]*\|\[.*\]\)\)/'
- cp -f CHANGELOG.md .releaseNotes.md
- sed -i "1,$${TagHeading}{ $${TagHeading}P ; d } ; $${HeadingPattern},\$d" .releaseNotes.md
- cp -f .releaseNotes.md .releaseTitle.md
- sed -i "2,\$d ; s$${HeadingPattern}\\\\1/" .releaseTitle.md
when:
event:
- tag
- name: publish release
image: plugins/github-release
depends_on:
- create package
- prepare release notes
commands: []
settings:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@ dist

# Temporary release-assets
.tagName.txt
.tagHeading.txt
.releaseNotes.md
.releaseTitle.md
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## TSProjectGenerator [Unreleased]

[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v3.0.12...v3.0.13)
[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v3.1.0...dev)

## TSProjectGenerator v3.1.0
### Updated
- All dependencies

### Fixed
- A few typos
- Formatting issues in `@manuth/generator-ts-project`s markdown files

### Added
- Steps to the drone-pipeline for verifying the `CHANGELOG.md` file and all access tokens
- The `DependabotFileMapping` to the exported classes of `@manuth/generator-my-ts-project`

### Removed
- Unnecessary dependencies
- Unnecessary npm scripts

[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v3.0.13...v3.1.0)

## TSProjectGenerator v3.0.13
### Fixed
Expand Down Expand Up @@ -338,7 +356,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Errors due to incorrect imports
- Errors due to the `cleanup` task being scoped incorrectly

## Updated
### Updated
- All packages

[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.0.2...v1.0.3)
Expand Down
Loading

0 comments on commit 5e0ec74

Please sign in to comment.