Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjcharles committed Sep 3, 2024
2 parents 14ef679 + c1a0957 commit 2761f5c
Show file tree
Hide file tree
Showing 53 changed files with 963 additions and 549 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
build-and-test:
needs: cancel_previous
runs-on: 'ubuntu-latest'
env:
YARN_ENABLE_HARDENED_MODE: 0
steps:
- uses: actions/checkout@v4
# Workaround for corepack enable in node
Expand All @@ -33,14 +35,15 @@ jobs:
run: yarn install --immutable
- name: Build
run: yarn build
# Linter has to run after the build because it relies on TS types
- name: Lint
run: yarn lint
- name: Test
run: yarn test --coverage

run-e2e-ios:
runs-on: 'macos-13'
env:
YARN_ENABLE_HARDENED_MODE: 0
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down Expand Up @@ -76,17 +79,19 @@ jobs:
run: yarn e2e test:ios

run-e2e-android:
runs-on: 'macos-latest' # This is important, linux cannot run the emulator graphically for e2e tests
runs-on: 'macos-13' # This is important, linux cannot run the emulator graphically for e2e tests
strategy:
matrix:
api-level: [21]
profile: ['pixel_xl']
env:
YARN_ENABLE_HARDENED_MODE: 0
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Gradle cache
Expand All @@ -112,7 +117,7 @@ jobs:
with:
api-level: ${{ matrix.api-level }}
profile: ${{matrix.profile}}
name: Pixel_API_21_AOSP
avd-name: Pixel_API_21_AOSP
target: default
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create_jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
id: create
uses: atlassian/gajira-create@master
with:
project: LIBWEB
project: LIBRARIES
issuetype: Bug
summary: |
[${{ github.event.repository.name }}] (${{ github.event.issue.number }}): ${{ github.event.issue.title }}
Expand All @@ -33,8 +33,8 @@ jobs:
${{ github.event.issue.body }}
# Parent and Epic Link fields (set to same)
fields: '{
"parent": {"key": "LIBWEB-1530"},
"customfield_10002": "LIBWEB-1530"
"parent": {"key": "LIBRARIES-2048"},
"customfield_10002": "LIBRARIES-2048"
}'

- name: Log created issue
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish
on:
workflow_dispatch:
secrets:
GITHUB_TOKEN:
GH_TOKEN:
required: true
NPM_TOKEN:
required: true
Expand Down 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).
Loading

0 comments on commit 2761f5c

Please sign in to comment.