chore: prepare for release

This commit is contained in:
Krzysztof Moch
2025-06-30 18:49:11 +02:00
parent 2cc3430afb
commit 0f55a372bf
5 changed files with 33 additions and 75 deletions

View File

@@ -43,7 +43,7 @@ The most battle-tested open-source video player component for React Native with
## 📚 Documentation & Examples
- 📖 Documentation - In progress 🏗️, will be available soon
- 📦 [Example: Basic Usage](https://github.com/TheWidlarzGroup/react-native-video-v7/tree/master/example)
- 📦 [Example: Basic Usage](https://github.com/TheWidlarzGroup/react-native-video/tree/master/example)
- 📦 [Example: Free DRM Stream](https://www.thewidlarzgroup.com/services/free-drm-token-generator-for-video?utm_source=rnv&utm_medium=readme&utm_id=free-drm)
- 📦 [Example: Offline SDK integration](https://docs.thewidlarzgroup.com/offline-video-sdk)

View File

@@ -1,8 +1,9 @@
{
"name": "@react-native-video",
"packageManager": "bun@1.1.42",
"version": "7.0.0-dev.13",
"private": true,
"repository": "https://github.com/TheWidlarzGroup/react-native-video-v7",
"repository": "https://github.com/TheWidlarzGroup/react-native-video",
"author": "TheWidlarzGroup <hi@thewidlarzgroup.com> (https://github.com/TheWidlarzGroup)",
"workspaces": [
"packages/react-native-video",
@@ -16,7 +17,9 @@
"clean": "git clean -xdf",
"react-native-video": "bun run --cwd packages/react-native-video",
"example": "bun run --cwd example",
"postinstall": "patch-package --patch-dir example/patches"
"postinstall": "patch-package --patch-dir example/patches",
"release:github": "release-it --preRelease alpha",
"release": "./scripts/release.sh"
},
"devDependencies": {
"@eslint/js": "^9.10.0",

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-video",
"version": "7.0.0-dev.12",
"version": "7.0.0-dev.13",
"description": "<Video /> Component for React Native",
"source": "./src/index.tsx",
"main": "./lib/commonjs/index.js",
@@ -51,7 +51,7 @@
"prepare": "bun run build",
"build": "bob build",
"nitrogen": "nitro-codegen",
"release": "release-it"
"release": "release-it --preRelease alpha --npm.tag=next"
},
"keywords": [
"react-native",
@@ -60,7 +60,7 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/TheWidlarzGroup/react-native-video-v7.git"
"url": "git+https://github.com/TheWidlarzGroup/react-native-video.git"
},
"author": "TheWidlarzGroup <hi@thewidlarzgroup.com> (https://github.com/TheWidlarzGroup)",
"license": "MIT",
@@ -69,8 +69,7 @@
},
"homepage": "https://github.com/TheWidlarzGroup/react-native-video#readme",
"publishConfig": {
"TODO_CHANGE_AFTER_PUBLISHING": "https://registry.npmjs.org/",
"registry": "https://npm.pkg.github.com/"
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@expo/config-plugins": "^10.0.2",
@@ -106,7 +105,7 @@
},
"hooks": {
"before:init": "bun typecheck && bun lint",
"after:bump": "bun run build"
"after:bump": "bun run build && cp ../../LICENSE ./LICENSE"
}
},
"react-native-builder-bob": {

View File

@@ -1,66 +0,0 @@
// Run "npm publish" in cli via Bun
import { $ } from 'bun';
import path from 'path';
import { fileURLToPath } from 'url';
const args = process.argv.slice(2);
const noRelease = args.includes("--no-release");
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootDir = path.join(__dirname, '..');
const DRY_RUN = args.includes("--dry-run");
const bumpVersion = (version) => {
const tagParts = version.split('-');
const versionParts = tagParts[1].split('.');
const newVersion = parseInt(versionParts[1]) + 1;
return `${tagParts[0]}-${versionParts[0]}.${newVersion}`;
}
const writeFile = async (path, content) => {
if (DRY_RUN) {
console.log(`DRY RUN: Would write to ${path}`);
console.log(content);
console.log('--------------------------------');
} else {
await Bun.write(path, content);
}
}
const runCommand = async (command) => {
if (DRY_RUN) {
console.log(`DRY RUN: Would run ${command}`);
return "";
} else {
return await $`${command}`.text();
}
}
const modifyPackage = async () => {
const packageJsonPath = path.join(rootDir, 'packages', 'react-native-video', 'package.json');
const packageJson = JSON.parse(await Bun.file(packageJsonPath).text());
// We need to modify the name of the package name to be exact as @ORGANIZATION/PACKAGE-NAME
const name = "@TheWidlarzGroup/react-native-video-v7";
const version = packageJson.version;
const newVersion = bumpVersion(version);
packageJson.name = name;
packageJson.version = newVersion;
await writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
};
let publishCommand = `npm publish --tag dev`;
await modifyPackage();
if (!noRelease) {
await runCommand(publishCommand);
}

22
scripts/release.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -e
echo "[React Native Video] Starting release process"
echo "[React Native Video] Options: $@"
echo "[React Native Video] Checking if we are in the correct directory"
if [ ! -d "packages/react-native-video" ]; then
echo "[React Native Video] Error: Not in the correct directory"
exit 1
fi
echo "[React Native Video] Publishing main package"
cd packages/react-native-video
bun run release $@
cd ../..
echo "[React Native Video] Making Github Release"
bun run release:github $@
echo "[React Native Video] Done"