Skip to content

Commit

Permalink
chore: version system
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed May 19, 2023
1 parent cda4364 commit efa7177
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function getDefaultConfig() {
repo: {
repo: 'oku-ui/primitives',
provider: 'github',
domain: 'github.com',
token: process.env.GITHUB_TOKEN,
},
}
}
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "oku-ui",
"name": "primitives",
"type": "module",
"version": "0.0.1",
"private": true,
"version": "0.0.0",
"packageManager": "pnpm@8.3.0",
"repository": "oku-ui/primitives",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function determineBumpType() {

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

return parseCommits(await getGitDiff(latestTag), config)
}
10 changes: 10 additions & 0 deletions scripts/add-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# get the version number from package.json
version=$(node -p -e "require('./package.json').version")
version="v$version"
# git tag it
git tag $version

# push it
git push origin $version
2 changes: 2 additions & 0 deletions scripts/update-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ async function main() {
const newVersion = inc(workspace.workspacePkg.data.version, bumpType || 'patch')
const changelog = await generateMarkDown(commits, config)
console.log(newVersion, 'newVersion')
console.log(changelog, 'changelog')

// Create and push a branch with bumped versions if it has not already been created
const branchExists = execSync(`git ls-remote --heads origin v${newVersion}`).toString().trim().length > 0
if (!branchExists) {
Expand Down

0 comments on commit efa7177

Please sign in to comment.