-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): v0.2.1-alpha.12 (#19)
- Loading branch information
1 parent
31a49ec
commit 125a822
Showing
5 changed files
with
36 additions
and
29 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
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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"repository": "github:CartoDB/carto-api-client", | ||
"author": "Don McCurdy <[email protected]>", | ||
"packageManager": "[email protected]", | ||
"version": "0.2.0", | ||
"version": "0.2.1-alpha.12", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public", | ||
|
@@ -40,7 +40,7 @@ | |
"clean": "rimraf build/*", | ||
"postversion": "yarn postversion:check && yarn postversion:commit && yarn postversion:push", | ||
"postversion:check": "yarn lint && yarn test", | ||
"postversion:commit": "VERSION=v$npm_package_version && node scripts/postversion-commit.js", | ||
"postversion:commit": "node scripts/postversion-commit.js", | ||
"postversion:push": "git push && git push --tags", | ||
"prepublish": "yarn lint && yarn test", | ||
"prepack": "yarn clean && yarn build" | ||
|
@@ -84,6 +84,7 @@ | |
"react-dom": "^18.3.1", | ||
"react-map-gl": "^7.1.7", | ||
"rimraf": "^3.0.2", | ||
"semver": "^7.6.3", | ||
"svelte": "^4.2.17", | ||
"typescript": "~5.3.3", | ||
"vite": "^5.2.10", | ||
|
@@ -97,5 +98,6 @@ | |
"@turf/invariant": "^7.1.0", | ||
"@turf/union": "^7.1.0", | ||
"@types/geojson": "^7946.0.14" | ||
} | ||
}, | ||
"stableVersion": "0.2.0" | ||
} |
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import {execSync} from 'node:child_process'; | ||
import assert from 'node:assert/strict'; | ||
import {readFile} from 'node:fs/promises'; | ||
import {resolve} from 'node:path'; | ||
import {valid} from 'semver'; | ||
|
||
/** | ||
* Utility for committing and tagging a release commit in | ||
* git, called as part of the `yarn postversion` script. | ||
*/ | ||
|
||
const version = process.env.VERSION; | ||
|
||
assert.match( | ||
version, | ||
/^v\d+\.\d+\.\d+[a-zA-Z0-9\._-]*$/, | ||
'Missing or invalid process.env.VERSION' | ||
); | ||
|
||
const currentBranch = execSync('git rev-parse --abbrev-ref HEAD') | ||
.toString() | ||
.trim(); | ||
// Read and validate pkg.version. | ||
const pkgJSON = await readFile(resolve('./package.json'), 'utf-8'); | ||
const version = 'v' + JSON.parse(pkgJSON).version; | ||
if (!valid(version)) { | ||
throw new Error(`Invalid version, "${version}"`); | ||
} | ||
|
||
if (currentBranch === 'main') { | ||
// Check out a branch if cutting a version from 'main'. | ||
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); | ||
if (branch === 'main') { | ||
execSync(`git checkout -b 'release/${version}'`); | ||
} | ||
|
||
// Commit and tag. | ||
execSync('git add -u'); | ||
execSync(`git commit -m 'chore(release): ${version}'`); | ||
execSync(`git tag -a ${version} -m ${version}`); |
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