add maintenance docs and missing script
This commit is contained in:
9
MAINTENANCE.md
Normal file
9
MAINTENANCE.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Maintenance instructions
|
||||
|
||||
## Releasing a new version
|
||||
|
||||
A new version can be released by running the [Create New Version](https://github.com/bcc-code/directus-schema-sync/actions/workflows/create-version.yml) workflow from GitHub.
|
||||
|
||||
This will update the version in the `package.json`, push a Git commit and tag, and create a new [release](https://github.com/bcc-code/directus-schema-sync/releases) in GitHub.
|
||||
|
||||
Maintainers can publish this release, after which the new version will be pushed to npm with the `latest` tag.
|
||||
@@ -32,7 +32,8 @@
|
||||
"link": "directus-extension link",
|
||||
"pre-test": "tsc -p tsconfig.test.json",
|
||||
"test": "npm run pre-test && node --test dist-test/",
|
||||
"create-version": "node ./scripts/version.cjs"
|
||||
"create-version": "node ./scripts/version.cjs",
|
||||
"release-channel": "node ./scripts/release-channel.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@directus/extensions-sdk": "10.1.11",
|
||||
|
||||
19
scripts/release-channel.js
Normal file
19
scripts/release-channel.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// Given a version, figure out what the release channel is so that we can publish to the correct
|
||||
// channel on npm.
|
||||
// Copied from https://github.com/tailwindlabs/heroicons/blob/eee05eb77af6cdedfb97f128d1998773fc984b28/scripts/release-channel.js
|
||||
//
|
||||
// E.g.:
|
||||
//
|
||||
// 1.2.3 -> latest (default)
|
||||
// 0.0.0-insiders.ffaa88 -> insiders
|
||||
// 4.1.0-alpha.4 -> alpha
|
||||
|
||||
let version =
|
||||
process.argv[2] || process.env.npm_package_version || require("../package.json").version;
|
||||
|
||||
let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version);
|
||||
if (match) {
|
||||
console.log(match[1]);
|
||||
} else {
|
||||
console.log("latest");
|
||||
}
|
||||
Reference in New Issue
Block a user