Skip to content

Commit

Permalink
chore(release): Add script to commit and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Oct 30, 2024
1 parent bb21fc2 commit e20b8fa
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/add/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"copypkgfiles": "yarn cleannpx && cp README.md ./npx/ && cp package.json ./npx/",
"copybin": "cp ./dist/*.js ./npx/dist",
"copyforrelease": "yarn copypkgfiles && yarn copybin",
"version:patch": "npm version patch --tag-version-prefix=rw-shad/v",
"version:minor": "npm version minor --tag-version-prefix=rw-shad/v",
"version:major": "npm version major --tag-version-prefix=rw-shad/v",
"version:patch": "yarn version patch && yarn tsx tag.ts",
"version:minor": "yarn version minor && yarn tsx tag.ts",
"version:major": "yarn version major && yarn tsx tag.ts",
"release:patch": "yarn build && yarn version:patch && yarn copyforrelease && cd npx && npm publish && git push --follow-tags",
"release:minor": "yarn build && yarn version:minor && yarn copyforrelease && cd npx && npm publish && git push --follow-tags",
"release:major": "yarn build && yarn version:major && yarn copyforrelease && cd npx && npm publish && git push --follow-tags"
Expand Down
17 changes: 17 additions & 0 deletions packages/add/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import fs from 'fs'

import execa from 'execa'

const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8'))

const { stdout: stdoutCommit } = await execa.command(
`git commit -am setup-rw-shad/v${packageJson.version}`,
)

console.log(stdoutCommit)

const { stdout: stdoutTag } = await execa.command(
`git tag setup-rw-shad/v${packageJson.version}`,
)

console.log(stdoutTag)
6 changes: 3 additions & 3 deletions packages/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"copybin": "cp ./dist/*.js ./npx/dist",
"copytemplates": "cp ./templates/* ./npx/templates/",
"copyforrelease": "yarn copypkgfiles && yarn copybin && yarn copytemplates",
"version:patch": "npm version patch --tag-version-prefix=setup-rw-shad/v",
"version:minor": "npm version minor --tag-version-prefix=setup-rw-shad/v",
"version:major": "npm version major --tag-version-prefix=setup-rw-shad/v",
"version:patch": "yarn version patch && yarn tsx tag.ts",
"version:minor": "yarn version minor && yarn tsx tag.ts",
"version:major": "yarn version major && yarn tsx tag.ts",
"release:patch": "yarn build && yarn version:patch && yarn copyforrelease && cd npx && npm publish && git push --follow-tags",
"release:minor": "yarn build && yarn version:minor && yarn copyforrelease && cd npx && npm publish && git push --follow-tags",
"release:major": "yarn build && yarn version:major && yarn copyforrelease && cd npx && npm publish && git push --follow-tags"
Expand Down
17 changes: 17 additions & 0 deletions packages/setup/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import fs from 'fs';

import execa from 'execa';

const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8'))

const { stdout: stdoutCommit } = await execa.command(
`git commit -am setup-rw-shad/v${packageJson.version}`
)

console.log(stdoutCommit)

const { stdout: stdoutTag } = await execa.command(
`git tag setup-rw-shad/v${packageJson.version}`
)

console.log(stdoutTag)

0 comments on commit e20b8fa

Please sign in to comment.