diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 692a3453e..1140ac8c5 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -3,6 +3,10 @@ name: Node.js build and publish package on: release: types: [ created ] + push: + branches: + - '**' + workflow_dispatch: jobs: build: @@ -24,6 +28,27 @@ jobs: node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm i - - run: npm publish + + - name: Publish Release + if: github.event_name == 'release' + run: npm publish env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Publish Test Version + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + run: | + BRANCH_NAME=${GITHUB_REF#refs/heads/} + echo "Branch: $BRANCH_NAME" + + # Determine the new version + NEW_VERSION=$(node scripts/bump-version.js "$BRANCH_NAME") + echo "New Version: $NEW_VERSION" + + # Set the version in package.json + npm version $NEW_VERSION --no-git-tag-version + + # Publish with 'test' tag + npm publish --tag test diff --git a/README.md b/README.md index e2bb87d9f..1e729b0d2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -#### [Sign up With Source Push](https://console.srcpush.com/register) to use CodePush SDK +#### [Sign up With Source Push](https://console.srcpush.com/register) to use Source Push SDK # React Native SDK for Source Push (CodePush compatible service) -This plugin provides client-side integration for the [CodePush service](https://srcpush.com/), allowing you to easily add a dynamic update experience to your React Native app(s). +This plugin provides client-side integration for the [Source Push service](https://srcpush.com/), allowing you to easily add a dynamic update experience to your React Native app(s). @@ -34,20 +34,20 @@ This plugin provides client-side integration for the [CodePush service](https:// A React Native app is composed of JavaScript files and any accompanying [images](https://reactnative.dev/docs/image), which are bundled together by the [metro bundler](https://github.com/facebook/metro) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to. -The CodePush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the CodePush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win! +The Source Push plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the Source Push server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win! -In order to ensure that your end users always have a functioning version of your app, the CodePush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server. It's a win-win-win! +In order to ensure that your end users always have a functioning version of your app, the Source Push plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server. It's a win-win-win! -*Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.m`/`MainActivity.java` file, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s).* +*Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.m`/`MainActivity.java` file, adding a new plugin) cannot be distributed via Source Push, and therefore, must be updated via the appropriate store(s).* ## Supported React Native platforms * iOS (7+) * Android (4.1+) on TLS 1.2 compatible devices -We try our best to maintain backwards compatibility of our plugin with previous versions of React Native, but due to the nature of the platform, and the existence of breaking changes between releases, it is possible that you need to use a specific version of the CodePush plugin in order to support the exact version of React Native you are using. The following table outlines which CodePush plugin versions officially support the respective React Native versions: +We try our best to maintain backwards compatibility of our plugin with previous versions of React Native, but due to the nature of the platform, and the existence of breaking changes between releases, it is possible that you need to use a specific version of the Source Push plugin in order to support the exact version of React Native you are using. The following table outlines which Source Push plugin versions officially support the respective React Native versions: -| React Native version(s) | Supporting CodePush version(s) | +| React Native version(s) | Supporting Source Push version(s) | |-------------------------|---------------------------------------------------------------------------------------------| | *(React Native 0.21.0+)* | `actions[].icon`, `logo`, `overflowIcon` | | `Video` | `source` | -The following list represents the set of components (and props) that don't currently support their assets being updated via CodePush, due to their dependency on static images and videos (i.e. using the `{ uri: "foo" }` syntax): +The following list represents the set of components (and props) that don't currently support their assets being updated via Source Push, due to their dependency on static images and videos (i.e. using the `{ uri: "foo" }` syntax): | Component | Prop(s) | |-------------|----------------------------------------------------------------------| | `SliderIOS` | `maximumTrackImage`, `minimumTrackImage`, `thumbImage`, `trackImage` | | `Video` | `source` | -As new core components are released, which support referencing assets, we'll update this list to ensure users know what exactly they can expect to update using CodePush. +As new core components are released, which support referencing assets, we'll update this list to ensure users know what exactly they can expect to update using Source Push. -*Note: CodePush only works with Video components when using `require` in the source prop. For example:* +*Note: Source Push only works with Video components when using `require` in the source prop. For example:* ```javascript