Skip to content

Commit c0fcbf4

Browse files
feat: switch from semantic-release to release-it (#110)
* feat: switch from semantic-release to release-it * docs too
1 parent 60b15c6 commit c0fcbf4

File tree

7 files changed

+1685
-656
lines changed

7 files changed

+1685
-656
lines changed

.github/workflows/release.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ on:
77

88
jobs:
99
release:
10-
name: Release
1110
runs-on: ubuntu-latest
12-
if: github.event.head_commit.message != 'Initial commit'
1311
steps:
1412
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
1515
- uses: ./.github/actions/prepare
16-
- run: pnpm build
17-
- name: Release
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
- run: git config user.name "${GITHUB_ACTOR}"
17+
- run: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
18+
- env:
2019
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
21-
run: npx semantic-release
22-
- run: cat CHANGELOG.md
20+
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
21+
- env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: pnpm release-it

.release-it.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"git": {
3+
"commitMessage": "chore: release v${version}"
4+
},
5+
"github": {
6+
"release": true,
7+
"releaseName": "v${version}"
8+
},
9+
"plugins": {
10+
"@release-it/conventional-changelog": {
11+
"infile": "CHANGELOG.md",
12+
"preset": "conventionalcommits"
13+
}
14+
}
15+
}

.releaserc.json

-29
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ It sets up the following tooling for you:
3535
- [**Markdownlint**](https://github.com/DavidAnson/markdownlint): Static analysis for Markdown code.
3636
- [**pnpm**](https://pnpm.io): Desk-efficient package manager alternative.
3737
- [**Prettier**](https://prettier.io): Opinionated formatting for code, run on file save and as a Git commit hook via [husky](https://typicode.github.io/husky) and [lint-staged](https://github.com/okonet/lint-staged).
38+
- [**release-it**](https://github.com/release-it/release-it): Generates changelogs, bumps the package version, and publishes to GitHub and npm based on [conventional commits](https://www.conventionalcommits.org).
3839
- [**ts-prune**](https://github.com/nadeesha/ts-prune): Unused exports detection for TypeScript code.
3940
- [**TypeScript**](https://typescriptlang.org): A typed superset of JavaScript, configured with strict compiler options.
4041
- [**Vitest**](https://vitest.dev): Fast unit tests, configured with coverage tracking.

cspell.json

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"codespace",
1414
"commitlint",
1515
"contributorsrc",
16+
"conventionalcommits",
17+
"infile",
1618
"lcov",
1719
"wontfix"
1820
]

package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
"author": "Josh Goldberg <[email protected]>",
33
"description": "Template TypeScript Node.js package with all the CI bells & whistles I commonly use. ✨",
44
"devDependencies": {
5-
"@semantic-release/changelog": "^6.0.1",
6-
"@semantic-release/commit-analyzer": "^9.0.2",
7-
"@semantic-release/exec": "^6.0.3",
8-
"@semantic-release/git": "^10.0.1",
9-
"@semantic-release/github": "^8.0.6",
10-
"@semantic-release/npm": "^9.0.1",
11-
"@semantic-release/release-notes-generator": "^10.0.3",
5+
"@release-it/conventional-changelog": "^5.1.1",
126
"@typescript-eslint/eslint-plugin": "^5.38.1",
137
"@typescript-eslint/parser": "^5.38.1",
148
"@vitest/coverage-istanbul": "^0.25.8",
@@ -33,7 +27,7 @@
3327
"npm-package-json-lint-config-default": "^5.0.0",
3428
"pnpm-deduplicate": "^0.4.0",
3529
"prettier": "^2.7.1",
36-
"semantic-release": "^19.0.5",
30+
"release-it": "^15.5.1",
3731
"sentences-per-line": "^0.2.1",
3832
"ts-prune": "^0.10.3",
3933
"typescript": "^4.8.4",

0 commit comments

Comments
 (0)