Skip to content

Commit

Permalink
ci: Update Publish CI and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
oscb committed Apr 29, 2024
1 parent d989acd commit b7f0908
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 25 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,3 @@ jobs:
yarn install --no-immutable
yarn e2e install --no-immutable
yarn example install --no-immutable
- name: Commit Updated App Locks
run: |
git config user.email "[email protected]"
git config user.name "semantic-release-bot"
git add yarn.lock
git add examples/E2E/yarn.lock
git add examples/AnalyticsReactNativeExample/yarn.lock
git commit -m "chore(release): update lockfiles [skip ci]" --no-verify
git push
47 changes: 34 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.

## Prerequisites

Follow the official guide for getting your [RN Environment setup](https://reactnative.dev/docs/0.72/environment-setup)

React Native requires different versions of the tools/languages you might be using already. Even among RN releases there might be different versions required. We recommend using the following tools to manage your toolsets:

- [Xcodes](https://github.com/XcodesOrg/XcodesApp)
- To manage different releases of Xcode. The latest release of RN is usually supported by the latest Xcode release but previous releases might not.
- [Mise](https://mise.jdx.dev/dev-tools/) or [ASDF](https://asdf-vm.com/guide/getting-started.html) for everything else
- Node, Ruby and Java version support might change amongst RN releases. These version managers let you manage multiple versions of them.

## Development workflow

To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package:
Expand All @@ -11,7 +22,7 @@ yarn bootstrap
```

While developing, you can run the [example app](/example/) to test your changes.

code
To start the packager:

```sh
Expand Down Expand Up @@ -52,16 +63,16 @@ yarn test
The are also end-to-end tests. First you will have to build the app and then run the tests:

```
# Start the server (*note there's a separate e2e command*
yarn example start:e2e
# Start the server (*note there's a separate e2e command*)
yarn e2e start:e2e
# iOS
yarn example e2e:build:ios
yarn example e2e:test:ios
yarn e2e e2e:build:ios
yarn e2e e2e:test:ios
# Android
yarn example e2e:build:android
yarn example e2e:test:android
yarn e2e e2e:build:android
yarn e2e e2e:test:android
```

To edit the Objective-C / Swift files, open `example/ios/AnalyticsReactNativeExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > @segment/analytics-react-native`.
Expand Down Expand Up @@ -100,12 +111,12 @@ The `package.json` file contains various scripts for common tasks:
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
- `yarn example e2e:build:ios`: builds the example app using detox
- `yarn example e2e:test:ios`: runs the e2e on a simulator(headless if not ran manually)
- `yarn example e2e:build:android`: builds the example app using detox
- `yarn example e2e:test:android`: runs the e2e on an emulator
- `yarn example ios:deeplink`: opens the ios app via deep link (example app must already be installed)
- `yarn example android:deeplink`: opens the Android app via deep link (example app must already be installed)
- `yarn e2e e2e:build:ios`: builds the e2e app using detox
- `yarn e2e e2e:test:ios`: runs the e2e on a simulator(headless if not ran manually)
- `yarn e2e e2e:build:android`: builds the e2e app using detox
- `yarn e2e e2e:test:android`: runs the e2e on an emulator
- `yarn e2e ios:deeplink`: opens the ios app via deep link (example app must already be installed)
- `yarn e2e android:deeplink`: opens the Android app via deep link (example app must already be installed)

### Sending a pull request

Expand All @@ -118,3 +129,13 @@ When you're sending a pull request:
- Review the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.

## Release

Release is automated in GHA. By default `yarn release` won't let you trigger a release from your personal computer.

To trigger a release go to Actions. Select the `Publish` workflow and trigger a new job.

Automatically the workflow will analyze the commits, bump versions, create changesets, build and release to NPM the packages that need so.

The CI/CD is automated using [semantic-release](https://github.com/semantic-release/semantic-release).
5 changes: 5 additions & 0 deletions examples/E2E-73/.mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tools]
java = "zulu-17"
node = "18"
ruby = '3.3.0'
cocoapods = "latest"
2 changes: 0 additions & 2 deletions examples/E2E-73/.rtx.toml

This file was deleted.

5 changes: 5 additions & 0 deletions examples/E2E/.mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tools]
java = "zulu-11"
node = "18"
ruby = '3.3.0'
cocoapods = "latest"

0 comments on commit b7f0908

Please sign in to comment.