Skip to content

Commit

Permalink
chore: improve release script
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Oct 8, 2024
1 parent b55cc8e commit bb6bfe9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
19 changes: 7 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,13 @@ npm run build

## 🏷️ Release

To create a new release, you will need to login on your machine once with `npm adduser` if not already done, then:
To create a new release, you will need to login on your machine once with `npm adduser` if not already done.

- Upgrade version in `package.json`:
Running the following script will upgrade version in `package.json`, generate changelog, create a tag, and trigger publish:

```bash
npm version patch | minor | major
```

- Run release script:

```bash
npm run release
```
```bash
npm version patch
# Or minor / major
```

> You will need to go through NPM 2FA, then a tag will be automatically created and pushed.
> You will need to go through NPM 2FA to publish.
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
"test": "npm run lint && vitest run",
"upgrade": "npx npm-check-updates -u && npm install",
"prepare": "husky",
"release": "version=v$(npm pkg get version | tr -d \\\") && echo $version && npm run lint && npm run build && npm publish && npm run changelog && git tag -a $version -m \"$version\" && git push origin $version",
"autorelease": "echo $version && sed -i \"s/^\\\"version\\\": \\\"[0-9]*\\.[0-9]*\\.[0-9]*\\\"\\$/\\\"version\\\": \\\"$version\\\"/\" \"package.json\"",
"version": "auto-changelog -p && git add CHANGELOG.md"
},
"scripts-info": {
"version": "changelog"
"version": "npm run lint && npm run build && auto-changelog -p && git add CHANGELOG.md && git push origin v$(npm pkg get version | tr -d \\\") && npm publish"
},
"dependencies": {
"@zazuko/yasgui": "^4.3.3",
Expand Down

0 comments on commit bb6bfe9

Please sign in to comment.