release-it stuff

This commit is contained in:
EthanShoeDev
2025-10-06 20:12:50 -04:00
parent 3f70c86bd4
commit c61f8ac01c
7 changed files with 123 additions and 13 deletions

View File

@@ -1,25 +1,39 @@
import { type Config } from 'release-it'; import { type Config } from 'release-it';
export default { export default {
npm: { publish: false, ignoreVersion: true },
git: { git: {
requireCleanWorkingDir: true, requireCleanWorkingDir: true,
commitMessage: 'chore(release): v${version}', tagName: '${npm.name}-v${version}',
tagName: 'v${version}', tagAnnotation: '${npm.name} v${version}',
tagMatch: '${npm.name}-v*',
commitMessage: 'chore(${npm.name}): release v${version}',
push: true, push: true,
}, },
github: { github: {
release: true, release: true,
assets: ['android/app/build/outputs/apk/release/app-release.apk'], releaseName: '${npm.name} v${version}',
assets: [
'android/app/build/outputs/apk/release/app-release.apk',
// or the AAB, if thats your primary store artifact:
// 'android/app/build/outputs/bundle/release/app-release.aab'
],
}, },
plugins: { plugins: {
'release-it-pnpm': {},
'@release-it/conventional-changelog': { '@release-it/conventional-changelog': {
preset: 'conventionalcommits', preset: 'conventionalcommits',
infile: 'CHANGELOG.md', infile: 'CHANGELOG.md',
gitRawCommitsOpts: { path: 'apps/mobile' },
}, },
}, },
hooks: { hooks: {
'before:init': ['pnpm run lint:check', 'pnpm run typecheck'], 'before:init': ['pnpm run lint:check', 'pnpm run typecheck'],
'before:github:release': 'pnpm run build:signed:apk', 'before:github:release': 'pnpm run build:signed:apk',
'after:release': 'echo "Released ${npm.name} v${version}"',
}, },
} satisfies Config; } satisfies Config;

View File

@@ -0,0 +1,42 @@
import type { Config } from 'release-it';
export default {
git: {
requireCleanWorkingDir: true,
tagName: '${npm.name}-v${version}',
tagAnnotation: '${npm.name} v${version}',
tagMatch: '${npm.name}-v*',
commitMessage: 'chore(${npm.name}): release v${version}',
push: true,
},
// This one *does* publish to npm
npm: {
publish: true,
// pass flags youd give to `npm publish`
publishArgs: ['--access', 'public'],
// (optional) skip npms own prepublish checks:
// skipChecks: true
},
github: {
release: true,
releaseName: '${npm.name} v${version}',
// optional: attach build artifacts
// assets: ['dist/**']
},
plugins: {
'@release-it/conventional-changelog': {
preset: 'conventionalcommits',
infile: 'CHANGELOG.md',
gitRawCommitsOpts: { path: 'packages/react-native-uniffi-russh' },
},
},
hooks: {
'before:init': ['pnpm run lint:check', 'pnpm run test'],
'before:npm:release': 'pnpm run build',
'after:release': 'echo "Published ${npm.name} v${version} to npm"',
},
} satisfies Config;

View File

@@ -79,6 +79,7 @@
"react-native": "0.81.4", "react-native": "0.81.4",
"react-native-builder-bob": "^0.40.13", "react-native-builder-bob": "^0.40.13",
"release-it": "^19.0.4", "release-it": "^19.0.4",
"release-it-pnpm": "^4.6.6",
"turbo": "^2.5.7", "turbo": "^2.5.7",
"typescript": "~5.9.2" "typescript": "~5.9.2"
}, },

View File

@@ -0,0 +1,42 @@
import { type Config } from 'release-it';
export default {
git: {
requireCleanWorkingDir: true,
tagName: '${npm.name}-v${version}',
tagAnnotation: '${npm.name} v${version}',
tagMatch: '${npm.name}-v*',
commitMessage: 'chore(${npm.name}): release v${version}',
push: true,
},
// This one *does* publish to npm
npm: {
publish: true,
// pass flags youd give to `npm publish`
publishArgs: ['--access', 'public'],
// (optional) skip npms own prepublish checks:
// skipChecks: true
},
github: {
release: true,
releaseName: '${npm.name} v${version}',
// optional: attach build artifacts
// assets: ['dist/**']
},
plugins: {
'@release-it/conventional-changelog': {
preset: 'conventionalcommits',
infile: 'CHANGELOG.md',
gitRawCommitsOpts: { path: 'packages/react-native-xtermjs-webview' },
},
},
hooks: {
'before:init': ['pnpm run lint:check', 'pnpm run test'],
'before:npm:release': 'pnpm run build',
'after:release': 'echo "Published ${npm.name} v${version} to npm"',
},
} satisfies Config;

View File

@@ -27,30 +27,32 @@
}, },
"devDependencies": { "devDependencies": {
"@epic-web/config": "^1.21.3", "@epic-web/config": "^1.21.3",
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
"@eslint-react/eslint-plugin": "^1.53.0",
"@eslint/js": "^9.35.0", "@eslint/js": "^9.35.0",
"@types/react": "~19.1.12", "@types/react": "~19.1.12",
"@types/react-dom": "^19.1.7", "@types/react-dom": "^19.1.7",
"@typescript-eslint/parser": "^8.44.0",
"@typescript-eslint/utils": "^8.43.0",
"@vitejs/plugin-react": "^5.0.2", "@vitejs/plugin-react": "^5.0.2",
"@xterm/addon-fit": "^0.10.0", "@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",
"js-base64": "^3.7.8",
"eslint": "^9.35.0", "eslint": "^9.35.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
"eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-hooks": "^5.2.0",
"@eslint-react/eslint-plugin": "^1.53.0",
"vite-plugin-singlefile": "^2.3.0",
"eslint-plugin-react-refresh": "^0.4.20", "eslint-plugin-react-refresh": "^0.4.20",
"@typescript-eslint/parser": "^8.44.0",
"@typescript-eslint/utils": "^8.43.0",
"globals": "^16.4.0", "globals": "^16.4.0",
"js-base64": "^3.7.8",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"prettier-plugin-organize-imports": "^4.2.0", "prettier-plugin-organize-imports": "^4.2.0",
"react": "19.1.0", "react": "19.1.0",
"react-dom": "19.1.0", "react-dom": "19.1.0",
"react-native-webview": "13.15.0", "react-native-webview": "13.15.0",
"release-it": "^19.0.4",
"release-it-pnpm": "^4.6.6",
"typescript": "~5.9.2", "typescript": "~5.9.2",
"typescript-eslint": "^8.44.0", "typescript-eslint": "^8.44.0",
"vite": "6.3.6", "vite": "6.3.6",
"vite-plugin-dts": "^4.5.4" "vite-plugin-dts": "^4.5.4",
"vite-plugin-singlefile": "^2.3.0"
} }
} }

View File

@@ -21,5 +21,5 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true
}, },
"include": ["vite.config.ts", "vite.config.internal.ts"] "include": ["vite.config.ts", "vite.config.internal.ts", ".release-it.ts"]
} }

11
pnpm-lock.yaml generated
View File

@@ -366,6 +366,9 @@ importers:
release-it: release-it:
specifier: ^19.0.4 specifier: ^19.0.4
version: 19.0.4(@types/node@24.3.0)(magicast@0.3.5) version: 19.0.4(@types/node@24.3.0)(magicast@0.3.5)
release-it-pnpm:
specifier: ^4.6.6
version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.3.0)(magicast@0.3.5))
turbo: turbo:
specifier: ^2.5.7 specifier: ^2.5.7
version: 2.5.8 version: 2.5.8
@@ -439,6 +442,12 @@ importers:
react-native-webview: react-native-webview:
specifier: 13.15.0 specifier: 13.15.0
version: 13.15.0(react-native@0.81.4(@babel/core@7.28.3)(@react-native-community/cli@20.0.2(typescript@5.9.2))(@types/react@19.1.12)(react@19.1.0))(react@19.1.0) version: 13.15.0(react-native@0.81.4(@babel/core@7.28.3)(@react-native-community/cli@20.0.2(typescript@5.9.2))(@types/react@19.1.12)(react@19.1.0))(react@19.1.0)
release-it:
specifier: ^19.0.4
version: 19.0.4(@types/node@24.3.0)(magicast@0.3.5)
release-it-pnpm:
specifier: ^4.6.6
version: 4.6.6(magicast@0.3.5)(release-it@19.0.4(@types/node@24.3.0)(magicast@0.3.5))
typescript: typescript:
specifier: ~5.9.2 specifier: ~5.9.2
version: 5.9.2 version: 5.9.2
@@ -14340,7 +14349,7 @@ snapshots:
changelogithub@13.16.0(magicast@0.3.5): changelogithub@13.16.0(magicast@0.3.5):
dependencies: dependencies:
ansis: 4.2.0 ansis: 4.2.0
c12: 3.1.0(magicast@0.3.5) c12: 3.3.0(magicast@0.3.5)
cac: 6.7.14 cac: 6.7.14
changelogen: 0.5.7(magicast@0.3.5) changelogen: 0.5.7(magicast@0.3.5)
convert-gitmoji: 0.1.5 convert-gitmoji: 0.1.5