Skip to content

Commit

Permalink
Merge branch 'release/v5.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Sep 24, 2022
2 parents ad28357 + a6b8920 commit a134f52
Show file tree
Hide file tree
Showing 52 changed files with 5,956 additions and 6,108 deletions.
95 changes: 67 additions & 28 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,61 +25,71 @@ steps:
- build
commands:
- xvfb-run npm run test
- name: create extension
- name: prepare release
image: node
depends_on:
- lint
- test
commands:
- npx vsce package
- 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: publish extension to ovsx marketplace
- name: check release prerequisites
image: node
depends_on:
- create extension
- prepare release
environment:
ACCESS_TOKEN:
VSCE_TOKEN:
from_secret: vsce_token
OVSX_TOKEN:
from_secret: ovsx_token
GITHUB_PUBLISH_TOKEN:
from_secret: github_publish_token
commands:
- npx ovsx publish --pat $ACCESS_TOKEN
when:
event:
- tag
ref:
- refs/tags/v[0-9]*.[0-9]*.[0-9]*
- name: publish extension to vscode marketplace
image: node
depends_on:
- publish extension to ovsx marketplace
environment:
ACCESS_TOKEN:
from_secret: azure_token
commands:
- npx vsce publish --pat $ACCESS_TOKEN
- npm i --no-save @octokit/rest
- export PUBLISHER=$$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json').toString()).publisher)")
- >
testOVSX() {
url='https://open-vsx.org/api/-/namespace/create?token='"$1"
output=$(curl -X POST $url --header 'Content-Type: application/json' --data-raw '{ "name": "'"$PUBLISHER"'" }')
node -e 'JSON.parse('"'$output'"').error.includes("Invalid access token") && process.exit(1);'
}
- >
testVSCE() {
npx vsce verify-pat $PUBLISHER --pat $1 > /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; }'
- testOVSX $OVSX_TOKEN || { echo "The Open VSX Token is invalid!" && false; }
- testVSCE $VSCE_TOKEN || { echo "The Visual Studio Marketplace Token is invalid!" && false; }
- testGitHub $GITHUB_PUBLISH_TOKEN || { echo "The GitHub Publish Token is invalid!" && false; }
when:
event:
- tag
ref:
- refs/tags/v[0-9]*.[0-9]*.[0-9]*
- name: prepare release
- name: create extension
image: node
depends_on:
- create extension
- check release prerequisites
commands:
- npm install @stdlib/utils-escape-regexp-string --no-save
- node -e "console.log(require('@stdlib/utils-escape-regexp-string')('${DRONE_TAG}'))" > .tagName.txt
- npx vsce package
when:
event:
- tag
- name: prepare release notes
image: alpine
depends_on:
- prepare release
- check release prerequisites
commands:
- export TagName=$$(cat .tagName.txt)
- export TagHeading="/## \(.* \($${TagName}\|\[$${TagName}\]\)\)\$/"
- 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
Expand All @@ -88,9 +98,38 @@ steps:
when:
event:
- tag
- name: publish extension to ovsx marketplace
image: node
depends_on:
- create extension
environment:
OVSX_TOKEN:
from_secret: ovsx_token
commands:
- npx ovsx publish --pat $OVSX_TOKEN
when:
event:
- tag
ref:
- refs/tags/v[0-9]*.[0-9]*.[0-9]*
- name: publish extension to vscode marketplace
image: node
depends_on:
- publish extension to ovsx marketplace
environment:
VSCE_TOKEN:
from_secret: vsce_token
commands:
- npx vsce publish --pat $VSCE_TOKEN
when:
event:
- tag
ref:
- refs/tags/v[0-9]*.[0-9]*.[0-9]*
- name: publish release
image: plugins/github-release
depends_on:
- create extension
- prepare release notes
commands: []
settings:
Expand Down
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const { join } = require("path");
const ESLintPresets = require("@manuth/eslint-plugin-typescript");
const { PluginName, PresetName } = require("@manuth/eslint-plugin-typescript");

module.exports = {
extends: [
`plugin:${ESLintPresets.PluginName}/${ESLintPresets.PresetName.RecommendedWithTypeChecking}`
`plugin:${PluginName}/${PresetName.RecommendedWithTypeChecking}`
],
env: {
node: true,
es6: true
},
parserOptions: {
project: [
join(__dirname, "tsconfig.json"),
join(__dirname, "tsconfig.app.json"),
join(__dirname, "tsconfig.eslint.json"),
join(__dirname, "tsconfig.webpack.json"),
join(__dirname, "tsconfig.web.json"),
join(__dirname, "src", "test", "tsconfig.json"),
join(__dirname, "src", "tests", "tsconfig.json")
]
Expand Down
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/auto-merge.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,6 @@ dist

# Temporary release-assets
.tagName.txt
.tagHeading.txt
.releaseNotes.md
.releaseTitle.md
9 changes: 5 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ bower_components
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

Expand Down Expand Up @@ -102,10 +106,6 @@ dist
# TernJS port file
.tern-port

# gulp-files
.gulp/
gulpfile.ts

# Source-files
[Ss]rc/

Expand Down Expand Up @@ -152,5 +152,6 @@ webpack.config.ts

# Temporary release-assets
.tagName.txt
.tagHeading.txt
.releaseNotes.md
.releaseTitle.md
6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

160 changes: 0 additions & 160 deletions .vscode/launch.json

This file was deleted.

Loading

0 comments on commit a134f52

Please sign in to comment.