Skip to content

Commit efa7177

Browse files
chore: version system
1 parent cda4364 commit efa7177

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

changelog.config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ function getDefaultConfig() {
2020
repo: {
2121
repo: 'oku-ui/primitives',
2222
provider: 'github',
23+
domain: 'github.com',
24+
token: process.env.GITHUB_TOKEN,
2325
},
2426
}
2527
}

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"name": "oku-ui",
2+
"name": "primitives",
33
"type": "module",
4-
"version": "0.0.1",
5-
"private": true,
4+
"version": "0.0.0",
65
"packageManager": "[email protected]",
76
"repository": "oku-ui/primitives",
87
"scripts": {

scripts/_utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function determineBumpType() {
7777

7878
export async function getLatestCommits() {
7979
const config = await loadChangelogConfig(process.cwd())
80-
const latestTag = execaSync('git', ['describe', '--tags', '--abbrev=0', '--always']).stdout
80+
const latestTag = execaSync('git', ['describe', '--tags', '--abbrev=0']).stdout
8181

8282
return parseCommits(await getGitDiff(latestTag), config)
8383
}

scripts/add-tag.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# get the version number from package.json
4+
version=$(node -p -e "require('./package.json').version")
5+
version="v$version"
6+
# git tag it
7+
git tag $version
8+
9+
# push it
10+
git push origin $version

scripts/update-changelog.ts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ async function main() {
1616
const newVersion = inc(workspace.workspacePkg.data.version, bumpType || 'patch')
1717
const changelog = await generateMarkDown(commits, config)
1818
console.log(newVersion, 'newVersion')
19+
console.log(changelog, 'changelog')
20+
1921
// Create and push a branch with bumped versions if it has not already been created
2022
const branchExists = execSync(`git ls-remote --heads origin v${newVersion}`).toString().trim().length > 0
2123
if (!branchExists) {

0 commit comments

Comments
 (0)