Skip to content

Commit

Permalink
updated scripts for releasing update
Browse files Browse the repository at this point in the history
  • Loading branch information
turnercore committed Aug 26, 2024
1 parent fc2f521 commit b7bcca5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"version": "node version-bump.mjs",
"rename": "node rename.mjs",
"release": "npm run release:tag --",
"release:tag": "git tag -a $npm_config_version -m 'Release $npm_config_version' && git push origin $npm_config_version"
"release": "node release.mjs"
},
"keywords": [
"Eagle",
Expand Down
18 changes: 18 additions & 0 deletions release.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// release.js
import { execSync } from "child_process"

const version = process.argv[2]

if (!version) {
console.error("Version argument is required.")
process.exit(1)
}

try {
execSync(`git tag -a ${version} -m 'Release ${version}'`)
execSync(`git push origin ${version}`)
console.log(`Successfully tagged and pushed ${version}`)
} catch (error) {
console.error(`Failed to tag and push version: ${version}`, error)
process.exit(1)
}

0 comments on commit b7bcca5

Please sign in to comment.