2020-03-03 23:25:03 +03:00
|
|
|
name: build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-21 22:02:13 +03:00
|
|
|
- trunk
|
2020-03-03 23:25:03 +03:00
|
|
|
pull_request:
|
2023-02-09 15:53:48 +03:00
|
|
|
merge_group:
|
2021-03-26 18:35:00 +03:00
|
|
|
schedule:
|
2022-11-21 13:42:31 +03:00
|
|
|
# Nightly builds against react-native@nightly at 4:00, Monday through Friday
|
|
|
|
- cron: 0 4 * * 1-5
|
2022-09-13 18:56:40 +03:00
|
|
|
env:
|
|
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
2022-11-29 16:15:40 +03:00
|
|
|
VisualStudioVersion: "17.0"
|
2023-03-31 12:43:20 +03:00
|
|
|
concurrency:
|
|
|
|
# Ensure single build of a pull request. `trunk` should not be affected.
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
2020-03-03 23:25:03 +03:00
|
|
|
jobs:
|
2021-01-25 12:11:07 +03:00
|
|
|
lint-commit:
|
|
|
|
name: "lint commit message"
|
2024-06-17 14:11:52 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2021-03-26 18:35:00 +03:00
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
2021-01-25 12:11:07 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2021-01-25 12:11:07 +03:00
|
|
|
with:
|
2023-10-23 19:16:59 +03:00
|
|
|
filter: blob:none
|
2021-01-25 12:11:07 +03:00
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2021-01-25 12:11:07 +03:00
|
|
|
- name: Lint commit message
|
|
|
|
run: |
|
2023-09-15 09:58:29 +03:00
|
|
|
npm run lint:commit
|
2023-02-20 13:46:55 +03:00
|
|
|
review:
|
|
|
|
permissions:
|
|
|
|
issues: write # comment on PRs (suggestion-bot)
|
|
|
|
pull-requests: write # create code reviews (suggestion-bot)
|
2022-01-05 16:02:26 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-25 09:08:40 +03:00
|
|
|
runner: [macos-14, windows-2022]
|
|
|
|
runs-on: ${{ matrix.runner }}
|
2021-11-17 13:36:05 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-03-03 23:25:03 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2020-07-27 20:29:19 +03:00
|
|
|
with:
|
2023-10-23 19:16:59 +03:00
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
|
|
|
with:
|
2022-02-22 23:07:45 +03:00
|
|
|
platform: node
|
2021-09-17 15:32:27 +03:00
|
|
|
- name: Deduplicate packages
|
2021-06-07 13:06:17 +03:00
|
|
|
run: |
|
2021-09-17 15:32:27 +03:00
|
|
|
yarn dedupe --check
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
2022-01-14 16:15:56 +03:00
|
|
|
- name: Validate generated files
|
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn generate:code
|
|
|
|
yarn generate:schema
|
2022-01-14 16:15:56 +03:00
|
|
|
if [[ -n "$GITHUB_TOKEN" ]]; then
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
git diff | yarn suggestion-bot
|
2022-01-14 16:15:56 +03:00
|
|
|
fi
|
|
|
|
git diff --exit-code
|
|
|
|
shell: bash
|
2020-07-21 18:38:59 +03:00
|
|
|
- name: ClangFormat
|
2024-04-25 09:08:40 +03:00
|
|
|
if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }}
|
2020-07-21 18:38:59 +03:00
|
|
|
env:
|
2020-12-12 13:52:39 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-07-21 18:38:59 +03:00
|
|
|
run: |
|
2020-10-02 16:36:22 +03:00
|
|
|
# TODO: GITHUB_TOKEN is not set if a PR comes from a forked repo.
|
|
|
|
# Ignore errors until we can create a GitHub PAT from a system
|
|
|
|
# account.
|
2024-08-21 17:44:25 +03:00
|
|
|
scripts/build/clang-format-diff.sh || true
|
2020-04-18 15:26:52 +03:00
|
|
|
- name: CocoaPods
|
2024-04-25 09:08:40 +03:00
|
|
|
if: ${{ runner.os == 'macOS' }}
|
2020-04-18 15:26:52 +03:00
|
|
|
run: |
|
|
|
|
echo "::add-matcher::.github/rubocop.json"
|
2023-10-24 13:07:31 +03:00
|
|
|
yarn lint:rb
|
2020-04-18 15:26:52 +03:00
|
|
|
echo "::remove-matcher owner=rubocop::"
|
|
|
|
echo "::add-matcher::.github/minitest.json"
|
2023-10-24 13:07:31 +03:00
|
|
|
yarn test:rb
|
2020-04-18 15:26:52 +03:00
|
|
|
echo "::remove-matcher owner=minitest::"
|
2022-01-26 12:53:37 +03:00
|
|
|
- name: Validate Gradle wrapper
|
2024-08-12 17:16:44 +03:00
|
|
|
uses: gradle/actions/wrapper-validation@v4
|
2022-01-26 12:53:37 +03:00
|
|
|
- name: Populate Gradle cache
|
|
|
|
uses: ./.github/actions/gradle
|
|
|
|
with:
|
|
|
|
arguments: clean
|
|
|
|
project-root: example
|
2020-04-18 15:26:52 +03:00
|
|
|
- name: JavaScript
|
2020-10-08 22:01:16 +03:00
|
|
|
env:
|
2020-12-12 13:52:39 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-04-18 15:26:52 +03:00
|
|
|
run: |
|
2020-10-08 22:01:16 +03:00
|
|
|
# TODO: GITHUB_TOKEN is not set if a PR comes from a forked repo.
|
|
|
|
# Ignore errors until we can create a GitHub PAT from a system
|
|
|
|
# account.
|
2024-04-25 09:08:40 +03:00
|
|
|
if [[ ${{ runner.os }} == macOS ]]; then
|
2023-08-31 19:53:40 +03:00
|
|
|
yarn format:js
|
|
|
|
if [[ -n "$GITHUB_TOKEN" ]]; then
|
|
|
|
git diff | yarn suggestion-bot
|
|
|
|
else
|
2024-03-12 12:12:30 +03:00
|
|
|
git diff
|
2023-08-31 19:53:40 +03:00
|
|
|
fi
|
2024-03-12 12:12:30 +03:00
|
|
|
git diff --exit-code
|
2022-06-07 09:21:44 +03:00
|
|
|
echo "::add-matcher::.github/eslint-stylish.json"
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn lint:js
|
2022-06-07 09:21:44 +03:00
|
|
|
echo "::remove-matcher owner=eslint-stylish::"
|
|
|
|
fi
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn tsc
|
2023-09-28 19:34:11 +03:00
|
|
|
yarn test:js
|
2022-06-07 09:21:44 +03:00
|
|
|
shell: bash
|
2021-02-06 13:11:56 +03:00
|
|
|
- name: ktlint
|
2024-04-25 09:08:40 +03:00
|
|
|
if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }}
|
2021-02-06 13:11:56 +03:00
|
|
|
run: |
|
|
|
|
brew install ktlint
|
|
|
|
echo "::add-matcher::.github/ktlint.json"
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn lint:kt
|
2021-02-06 13:11:56 +03:00
|
|
|
echo "::remove-matcher owner=ktlint::"
|
2020-11-16 13:20:09 +03:00
|
|
|
- name: SwiftFormat
|
2024-04-25 09:08:40 +03:00
|
|
|
if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }}
|
2020-11-16 13:20:09 +03:00
|
|
|
run: |
|
|
|
|
echo "::add-matcher::.github/swiftformat.json"
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn format:swift --lint
|
2020-11-16 13:20:09 +03:00
|
|
|
echo "::remove-matcher owner=swiftformat::"
|
2020-07-21 23:03:19 +03:00
|
|
|
- name: SwiftLint
|
2024-04-25 09:08:40 +03:00
|
|
|
if: ${{ runner.os == 'macOS' }}
|
2020-07-21 23:03:19 +03:00
|
|
|
run: |
|
2024-04-25 01:54:40 +03:00
|
|
|
brew install swiftlint
|
2020-07-21 23:03:19 +03:00
|
|
|
echo "::add-matcher::.github/swiftlint.json"
|
|
|
|
swiftlint
|
|
|
|
echo "::remove-matcher owner=swiftlint::"
|
2024-02-20 17:56:51 +03:00
|
|
|
- name: Smoke test `npx --package react-native-test-app@latest init`
|
|
|
|
run: |
|
2024-02-24 12:06:06 +03:00
|
|
|
node ./react-native-test-app/scripts/init.mjs --destination app --name App -p android -p ios -p macos -p windows
|
2024-02-20 17:56:51 +03:00
|
|
|
working-directory: ..
|
2023-07-14 12:44:41 +03:00
|
|
|
- name: Smoke test `setup-react-native` action
|
|
|
|
uses: ./.github/actions/setup-react-native
|
|
|
|
with:
|
|
|
|
version: nightly
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-04-24 19:02:29 +03:00
|
|
|
ios:
|
|
|
|
name: "iOS"
|
2024-02-01 13:45:58 +03:00
|
|
|
runs-on: macos-14
|
2020-04-09 18:19:18 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2022-02-22 23:07:45 +03:00
|
|
|
with:
|
|
|
|
platform: ios
|
2023-02-21 22:45:55 +03:00
|
|
|
project-root: example
|
|
|
|
cache-key-prefix: example
|
2021-03-28 01:14:19 +03:00
|
|
|
- name: Set up react-native@nightly
|
2021-03-26 18:35:00 +03:00
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
2023-07-14 12:44:41 +03:00
|
|
|
uses: ./.github/actions/setup-react-native
|
|
|
|
with:
|
|
|
|
version: nightly
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
|
|
|
with:
|
|
|
|
immutable: ${{ github.event_name != 'schedule' }}
|
|
|
|
- name: Bundle JavaScript
|
2020-04-18 15:26:52 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn build:ios || yarn build:ios
|
2021-12-02 17:19:32 +03:00
|
|
|
working-directory: example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the iOS app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install Pods
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
uses: ./.github/actions/cocoapods
|
|
|
|
with:
|
|
|
|
project-directory: ios
|
|
|
|
working-directory: example
|
|
|
|
- name: Build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh ios/Example.xcworkspace build-for-testing
|
2020-04-18 15:26:52 +03:00
|
|
|
working-directory: example
|
2021-07-02 14:27:25 +03:00
|
|
|
- name: Test `react-native config`
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-07-02 14:27:25 +03:00
|
|
|
run: |
|
2023-09-28 19:34:11 +03:00
|
|
|
node --test test/config.test.mjs
|
2021-07-02 14:27:25 +03:00
|
|
|
working-directory: example
|
2020-04-18 15:26:52 +03:00
|
|
|
- name: Test
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2020-04-18 15:26:52 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh ios/Example.xcworkspace test-without-building
|
2020-04-18 15:26:52 +03:00
|
|
|
working-directory: example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-04-24 19:02:29 +03:00
|
|
|
ios-template:
|
2020-06-02 12:48:41 +03:00
|
|
|
name: "iOS [template]"
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
template: [all, ios]
|
2024-02-01 13:45:58 +03:00
|
|
|
runs-on: macos-14
|
2021-11-17 13:36:05 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-03-20 14:42:06 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2022-02-22 23:07:45 +03:00
|
|
|
with:
|
|
|
|
platform: ios
|
2023-02-21 22:45:55 +03:00
|
|
|
project-root: example
|
|
|
|
cache-key-prefix: template-${{ matrix.template }}
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Initialize test app
|
|
|
|
uses: ./.github/actions/init-test-app
|
2020-07-16 15:04:59 +03:00
|
|
|
with:
|
2021-12-02 17:19:32 +03:00
|
|
|
platform: ${{ matrix.template }}
|
|
|
|
- name: Bundle JavaScript
|
2020-04-18 15:26:52 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn build:ios || yarn build:ios
|
2021-12-02 17:19:32 +03:00
|
|
|
working-directory: template-example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the iOS app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Determine project directory
|
|
|
|
id: configure
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2020-06-02 12:48:41 +03:00
|
|
|
if [[ ${{ matrix.template }} == ios ]]; then
|
2022-10-21 22:34:36 +03:00
|
|
|
echo 'project-directory=.' >> $GITHUB_OUTPUT
|
2020-06-02 12:48:41 +03:00
|
|
|
else
|
2022-10-21 22:34:36 +03:00
|
|
|
echo 'project-directory=ios' >> $GITHUB_OUTPUT
|
2020-06-02 12:48:41 +03:00
|
|
|
fi
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install Pods
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2023-09-21 15:26:45 +03:00
|
|
|
pod install --project-directory=${{ steps.configure.outputs.project-directory }}
|
2021-12-02 17:19:32 +03:00
|
|
|
working-directory: template-example
|
|
|
|
- name: Build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh ${{ steps.configure.outputs.project-directory }}/TemplateExample.xcworkspace build
|
2020-04-18 15:26:52 +03:00
|
|
|
working-directory: template-example
|
2021-06-30 11:25:51 +03:00
|
|
|
- name: react-native run-ios
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.ios != '' }}
|
2021-06-30 11:25:51 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/testing/react-native.mjs run-ios
|
2021-06-30 11:25:51 +03:00
|
|
|
working-directory: template-example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-04-24 19:02:29 +03:00
|
|
|
android:
|
|
|
|
name: "Android"
|
2020-03-26 01:47:29 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-10-22 21:05:23 +03:00
|
|
|
runner: [ubuntu-24.04, windows-2022]
|
2024-04-25 09:08:40 +03:00
|
|
|
runs-on: ${{ matrix.runner }}
|
2020-03-26 01:47:29 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
|
|
|
with:
|
|
|
|
platform: android
|
2021-03-28 01:14:19 +03:00
|
|
|
- name: Set up react-native@nightly
|
2021-03-26 18:35:00 +03:00
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
2023-07-14 12:44:41 +03:00
|
|
|
uses: ./.github/actions/setup-react-native
|
|
|
|
with:
|
|
|
|
version: nightly
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
|
|
|
with:
|
|
|
|
immutable: ${{ github.event_name != 'schedule' }}
|
2021-07-02 14:27:25 +03:00
|
|
|
- name: Test `react-native config`
|
|
|
|
run: |
|
2023-09-28 19:34:11 +03:00
|
|
|
node --test test/config.test.mjs
|
2021-07-02 14:27:25 +03:00
|
|
|
working-directory: example
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Bundle JavaScript
|
2022-11-05 13:12:58 +03:00
|
|
|
# Metro on nightlies currently fails with "SHA-1 for file index.js is
|
|
|
|
# not computed" so we'll skip this step for now.
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' || runner.os != 'Windows' }}
|
2020-04-18 15:26:52 +03:00
|
|
|
run: |
|
2020-08-06 15:33:56 +03:00
|
|
|
yarn build:android || yarn build:android
|
2021-03-28 01:14:19 +03:00
|
|
|
shell: bash
|
2020-04-18 15:26:52 +03:00
|
|
|
working-directory: example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the Android app needs to be built
|
|
|
|
id: affected
|
2022-11-05 13:12:58 +03:00
|
|
|
# Nightlies currently fail on Windows because of wrong path separators.
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' || runner.os != 'Windows' }}
|
|
|
|
uses: ./.github/actions/affected
|
|
|
|
- name: Build
|
|
|
|
if: ${{ steps.affected.outputs.android != '' }}
|
2022-01-12 16:32:01 +03:00
|
|
|
uses: ./.github/actions/gradle
|
|
|
|
with:
|
|
|
|
project-root: example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-04-24 19:02:29 +03:00
|
|
|
android-template:
|
2020-06-02 12:48:41 +03:00
|
|
|
name: "Android [template]"
|
2020-03-31 12:24:48 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-06-02 12:48:41 +03:00
|
|
|
template: [all, android]
|
2024-10-22 21:05:23 +03:00
|
|
|
runner: [ubuntu-24.04, windows-2022]
|
2024-04-25 09:08:40 +03:00
|
|
|
runs-on: ${{ matrix.runner }}
|
2021-11-17 13:36:05 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-03-31 12:24:48 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2020-07-16 15:04:59 +03:00
|
|
|
with:
|
2021-12-02 17:19:32 +03:00
|
|
|
platform: android
|
|
|
|
- name: Initialize test app
|
|
|
|
uses: ./.github/actions/init-test-app
|
|
|
|
with:
|
|
|
|
platform: ${{ matrix.template }}
|
|
|
|
- name: Bundle JavaScript
|
2021-06-24 16:15:59 +03:00
|
|
|
run: |
|
2021-12-02 17:19:32 +03:00
|
|
|
yarn build:android || yarn build:android
|
2021-06-24 16:15:59 +03:00
|
|
|
shell: bash
|
|
|
|
working-directory: template-example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the Android app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2020-04-18 15:26:52 +03:00
|
|
|
- name: Build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.android != '' }}
|
2022-01-12 16:32:01 +03:00
|
|
|
uses: ./.github/actions/gradle
|
|
|
|
with:
|
|
|
|
project-root: template-example
|
2021-06-30 11:25:51 +03:00
|
|
|
- name: react-native run-android
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.android != '' }}
|
2021-06-30 11:25:51 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/testing/react-native.mjs run-android
|
2021-06-30 11:25:51 +03:00
|
|
|
working-directory: template-example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-06-03 16:05:09 +03:00
|
|
|
macos:
|
|
|
|
name: "macOS"
|
2024-02-01 13:45:58 +03:00
|
|
|
runs-on: macos-14
|
2024-01-15 18:57:17 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-06-03 16:05:09 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2022-02-22 23:07:45 +03:00
|
|
|
with:
|
|
|
|
platform: macos
|
2023-02-21 22:45:55 +03:00
|
|
|
project-root: example
|
|
|
|
cache-key-prefix: example
|
2021-06-13 13:43:59 +03:00
|
|
|
- name: Set up react-native@canary
|
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
2023-07-14 12:44:41 +03:00
|
|
|
uses: ./.github/actions/setup-react-native
|
|
|
|
with:
|
|
|
|
version: canary-macos
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
|
|
|
with:
|
|
|
|
immutable: ${{ github.event_name != 'schedule' }}
|
|
|
|
- name: Bundle JavaScript
|
2020-06-03 16:05:09 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn build:macos || yarn build:macos
|
2021-12-02 17:19:32 +03:00
|
|
|
working-directory: example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the macOS app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install Pods
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
uses: ./.github/actions/cocoapods
|
|
|
|
with:
|
|
|
|
project-directory: macos
|
|
|
|
working-directory: example
|
2022-01-25 13:23:53 +03:00
|
|
|
- name: Build x86
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build-for-testing
|
2020-07-06 14:33:40 +03:00
|
|
|
working-directory: example
|
2021-07-02 14:27:25 +03:00
|
|
|
- name: Test `react-native config`
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-07-02 14:27:25 +03:00
|
|
|
run: |
|
2023-09-28 19:34:11 +03:00
|
|
|
node --test test/config.test.mjs
|
2021-07-02 14:27:25 +03:00
|
|
|
working-directory: example
|
2020-07-06 14:33:40 +03:00
|
|
|
- name: Test
|
2024-08-14 20:20:46 +03:00
|
|
|
# Temporarily disabled due to random failures
|
|
|
|
if: false # ${{ steps.affected.outputs.macos != '' && github.event_name != 'schedule' }}
|
2020-07-06 14:33:40 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh macos/Example.xcworkspace test-without-building
|
2020-06-03 16:05:09 +03:00
|
|
|
working-directory: example
|
2023-01-16 19:03:10 +03:00
|
|
|
- name: Prepare for arm64 build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-01-13 13:20:07 +03:00
|
|
|
run: |
|
2022-02-22 23:07:45 +03:00
|
|
|
rm -fr macos/build
|
2023-01-16 19:03:10 +03:00
|
|
|
working-directory: example
|
|
|
|
- name: Install Pods
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2023-01-16 19:03:10 +03:00
|
|
|
uses: ./.github/actions/cocoapods
|
|
|
|
with:
|
|
|
|
project-directory: macos
|
|
|
|
working-directory: example
|
|
|
|
- name: Build arm64
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2023-01-16 19:03:10 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh macos/Example.xcworkspace build ARCHS=arm64
|
2021-01-13 13:20:07 +03:00
|
|
|
working-directory: example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-06-04 13:40:00 +03:00
|
|
|
macos-template:
|
|
|
|
name: "macOS [template]"
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
template: [all, macos]
|
2024-02-01 13:45:58 +03:00
|
|
|
runs-on: macos-14
|
2021-11-17 13:36:05 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-06-04 13:40:00 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2022-02-22 23:07:45 +03:00
|
|
|
with:
|
|
|
|
platform: macos
|
2023-02-21 22:45:55 +03:00
|
|
|
project-root: example
|
|
|
|
cache-key-prefix: template-${{ matrix.template }}
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Initialize test app
|
|
|
|
uses: ./.github/actions/init-test-app
|
2020-07-16 15:04:59 +03:00
|
|
|
with:
|
2021-12-02 17:19:32 +03:00
|
|
|
platform: ${{ matrix.template }}
|
|
|
|
- name: Bundle JavaScript
|
2020-06-04 13:40:00 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn build:macos || yarn build:macos
|
2021-12-02 17:19:32 +03:00
|
|
|
working-directory: template-example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the macOS app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Determine project directory
|
|
|
|
id: configure
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2020-06-04 13:40:00 +03:00
|
|
|
if [[ ${{ matrix.template }} == macos ]]; then
|
2022-10-21 22:34:36 +03:00
|
|
|
echo 'project-directory=.' >> $GITHUB_OUTPUT
|
2020-06-04 13:40:00 +03:00
|
|
|
else
|
2022-10-21 22:34:36 +03:00
|
|
|
echo 'project-directory=macos' >> $GITHUB_OUTPUT
|
2020-06-04 13:40:00 +03:00
|
|
|
fi
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install Pods
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
|
|
|
pod install --project-directory=${{ steps.configure.outputs.project-directory }}
|
|
|
|
working-directory: template-example
|
|
|
|
- name: Build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.macos != '' }}
|
2021-12-02 17:19:32 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh ${{ steps.configure.outputs.project-directory }}/TemplateExample.xcworkspace build
|
2020-06-04 13:40:00 +03:00
|
|
|
working-directory: template-example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2024-03-12 11:08:16 +03:00
|
|
|
visionos:
|
|
|
|
name: "visionOS"
|
|
|
|
runs-on: macos-14
|
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
|
|
|
with:
|
|
|
|
platform: visionos
|
|
|
|
project-root: example
|
|
|
|
cache-key-prefix: example
|
|
|
|
xcode-developer-dir: /Applications/Xcode_15.2.app
|
|
|
|
- name: Set up react-native@nightly
|
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
|
|
|
uses: ./.github/actions/setup-react-native
|
|
|
|
with:
|
|
|
|
version: nightly
|
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
|
|
|
with:
|
|
|
|
immutable: ${{ github.event_name != 'schedule' }}
|
|
|
|
- name: Bundle JavaScript
|
|
|
|
run: |
|
|
|
|
yarn build:visionos || yarn build:visionos
|
|
|
|
working-directory: example
|
|
|
|
- name: Determine whether the visionOS app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
|
|
|
- name: Install Pods
|
|
|
|
if: ${{ steps.affected.outputs.visionos != '' }}
|
|
|
|
uses: ./.github/actions/cocoapods
|
|
|
|
with:
|
|
|
|
project-directory: visionos
|
|
|
|
working-directory: example
|
|
|
|
- name: Build
|
|
|
|
if: ${{ steps.affected.outputs.visionos != '' }}
|
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh visionos/Example.xcworkspace build-for-testing
|
2024-03-12 11:08:16 +03:00
|
|
|
working-directory: example
|
|
|
|
- name: Test `react-native config`
|
|
|
|
if: ${{ steps.affected.outputs.visionos != '' }}
|
|
|
|
run: |
|
|
|
|
node --test test/config.test.mjs
|
|
|
|
working-directory: example
|
|
|
|
timeout-minutes: 60
|
|
|
|
visionos-template:
|
|
|
|
name: "visionOS [template]"
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
template: [all, visionos]
|
|
|
|
runs-on: macos-14
|
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
|
|
|
with:
|
|
|
|
platform: visionos
|
|
|
|
project-root: example
|
|
|
|
cache-key-prefix: template-${{ matrix.template }}
|
|
|
|
xcode-developer-dir: /Applications/Xcode_15.2.app
|
|
|
|
- name: Initialize test app
|
|
|
|
uses: ./.github/actions/init-test-app
|
|
|
|
with:
|
|
|
|
platform: ${{ matrix.template }}
|
|
|
|
- name: Bundle JavaScript
|
|
|
|
run: |
|
|
|
|
yarn build:visionos || yarn build:visionos
|
|
|
|
working-directory: template-example
|
|
|
|
- name: Determine whether the visionOS app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
|
|
|
- name: Determine project directory
|
|
|
|
id: configure
|
|
|
|
if: ${{ steps.affected.outputs.visionos != '' }}
|
|
|
|
run: |
|
|
|
|
if [[ ${{ matrix.template }} == visionos ]]; then
|
|
|
|
echo 'project-directory=.' >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo 'project-directory=visionos' >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
- name: Install Pods
|
|
|
|
if: ${{ steps.affected.outputs.visionos != '' }}
|
|
|
|
run: |
|
|
|
|
pod install --project-directory=${{ steps.configure.outputs.project-directory }}
|
|
|
|
working-directory: template-example
|
|
|
|
- name: Build
|
|
|
|
if: ${{ steps.affected.outputs.visionos != '' }}
|
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../scripts/build/xcodebuild.sh ${{ steps.configure.outputs.project-directory }}/TemplateExample.xcworkspace build
|
2024-03-12 11:08:16 +03:00
|
|
|
working-directory: template-example
|
|
|
|
timeout-minutes: 60
|
2020-08-28 17:39:13 +03:00
|
|
|
windows:
|
|
|
|
name: "Windows"
|
2024-04-25 09:08:40 +03:00
|
|
|
runs-on: windows-2022
|
2020-08-28 17:39:13 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-06-13 13:43:59 +03:00
|
|
|
platform: [ARM64, x64]
|
2020-08-28 17:39:13 +03:00
|
|
|
configuration: [Debug, Release]
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2020-08-28 17:39:13 +03:00
|
|
|
with:
|
2021-12-02 17:19:32 +03:00
|
|
|
platform: windows
|
2021-06-13 13:43:59 +03:00
|
|
|
- name: Set up react-native@canary
|
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
2023-07-14 12:44:41 +03:00
|
|
|
uses: ./.github/actions/setup-react-native
|
|
|
|
with:
|
|
|
|
version: canary-windows
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
|
|
|
with:
|
|
|
|
immutable: ${{ github.event_name != 'schedule' }}
|
2024-03-19 20:14:24 +03:00
|
|
|
- name: Bundle JavaScript
|
2020-08-28 17:39:13 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn build:windows
|
2024-03-19 20:14:24 +03:00
|
|
|
- name: Generate Visual Studio solution
|
|
|
|
run: |
|
2024-03-21 15:23:52 +03:00
|
|
|
yarn install-windows-test-app --use-nuget
|
2020-08-28 17:39:13 +03:00
|
|
|
working-directory: example
|
2021-07-02 14:27:25 +03:00
|
|
|
- name: Test `react-native config`
|
|
|
|
run: |
|
2023-09-28 19:34:11 +03:00
|
|
|
node --test test/config.test.mjs
|
2021-07-02 14:27:25 +03:00
|
|
|
working-directory: example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the Windows app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2020-08-28 17:39:13 +03:00
|
|
|
- name: Build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.windows != '' }}
|
2020-08-28 17:39:13 +03:00
|
|
|
run: |
|
2022-03-30 13:03:08 +03:00
|
|
|
if ("${{ matrix.configuration }}" -eq "Release") {
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn ci:windows --release --arch ${{ matrix.platform }}
|
2022-03-30 13:03:08 +03:00
|
|
|
} else {
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn ci:windows --arch ${{ matrix.platform }}
|
2022-03-30 13:03:08 +03:00
|
|
|
}
|
2020-08-28 17:39:13 +03:00
|
|
|
working-directory: example/windows
|
2020-08-31 14:08:21 +03:00
|
|
|
- name: Test
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.windows != '' && matrix.platform == 'x64' }}
|
2020-08-31 14:08:21 +03:00
|
|
|
run: |
|
2024-08-21 17:44:25 +03:00
|
|
|
../../../scripts/build/MSBuild.ps1 -Configuration ${{ matrix.configuration }} -Platform ${{ matrix.platform }} -Target Build ReactAppTests.vcxproj
|
|
|
|
../../../scripts/build/VSTest.ps1 ${{ matrix.platform }}\${{ matrix.configuration }}\ReactAppTests.dll
|
2024-04-25 01:54:40 +03:00
|
|
|
working-directory: example/windows/ReactAppTests
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-09-04 00:10:45 +03:00
|
|
|
windows-template:
|
|
|
|
name: "Windows [template]"
|
2024-04-25 09:08:40 +03:00
|
|
|
runs-on: windows-2022
|
2021-11-17 13:36:05 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-09-04 00:10:45 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
template: [all, windows]
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
2020-09-04 00:10:45 +03:00
|
|
|
with:
|
2021-12-02 17:19:32 +03:00
|
|
|
platform: windows
|
|
|
|
- name: Initialize test app
|
|
|
|
uses: ./.github/actions/init-test-app
|
|
|
|
with:
|
|
|
|
platform: ${{ matrix.template }}
|
2024-03-19 20:14:24 +03:00
|
|
|
- name: Bundle JavaScript
|
2020-09-04 00:10:45 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn build:windows
|
2024-03-19 20:14:24 +03:00
|
|
|
- name: Generate Visual Studio solution
|
|
|
|
run: |
|
2024-03-21 15:23:52 +03:00
|
|
|
if ("${{ matrix.template }}" -eq "all") { yarn install-windows-test-app --use-nuget }
|
|
|
|
else { yarn install-windows-test-app --project-directory=. --use-nuget }
|
2020-09-04 00:10:45 +03:00
|
|
|
working-directory: template-example
|
2023-10-23 19:16:59 +03:00
|
|
|
- name: Determine whether the Windows app needs to be built
|
|
|
|
id: affected
|
|
|
|
uses: ./.github/actions/affected
|
2020-09-04 00:10:45 +03:00
|
|
|
- name: Build
|
2023-10-23 19:16:59 +03:00
|
|
|
if: ${{ steps.affected.outputs.windows != '' }}
|
2020-09-04 00:10:45 +03:00
|
|
|
run: |
|
2024-02-26 13:30:11 +03:00
|
|
|
yarn windows --logging --no-packager --no-launch --no-deploy
|
2020-09-04 00:10:45 +03:00
|
|
|
working-directory: template-example
|
2022-02-08 13:04:15 +03:00
|
|
|
timeout-minutes: 60
|
2020-04-24 19:02:29 +03:00
|
|
|
release:
|
2023-02-20 13:46:55 +03:00
|
|
|
permissions:
|
|
|
|
contents: write # create releases (semantic-release)
|
2024-05-20 16:32:22 +03:00
|
|
|
id-token: write # enable use of OIDC for npm provenance (semantic-release)
|
2020-04-24 19:02:29 +03:00
|
|
|
needs:
|
2024-02-06 18:01:34 +03:00
|
|
|
- review
|
|
|
|
- ios
|
|
|
|
- ios-template
|
|
|
|
- android
|
|
|
|
- android-template
|
|
|
|
- macos
|
|
|
|
- macos-template
|
|
|
|
- windows
|
|
|
|
- windows-template
|
2024-06-17 14:11:52 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2021-11-17 13:36:05 +03:00
|
|
|
if: ${{ github.event_name != 'schedule' }}
|
2020-04-24 19:02:29 +03:00
|
|
|
steps:
|
2020-07-27 20:29:19 +03:00
|
|
|
- name: Checkout
|
2023-09-15 10:49:22 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-10-23 19:16:59 +03:00
|
|
|
with:
|
|
|
|
filter: blob:none
|
|
|
|
fetch-depth: 0
|
2021-12-02 17:19:32 +03:00
|
|
|
- name: Set up toolchain
|
|
|
|
uses: ./.github/actions/setup-toolchain
|
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: ./.github/actions/yarn
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
- name: Verify tarball content
|
|
|
|
run: |
|
2024-07-22 16:11:23 +03:00
|
|
|
yarn test test/pack.test.ts
|
2020-04-24 19:02:29 +03:00
|
|
|
- name: Release
|
|
|
|
env:
|
2020-12-12 13:52:39 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-04-24 19:02:29 +03:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2020-09-14 10:27:39 +03:00
|
|
|
run: |
|
chore: avoid complex glob patterns to work around issues with npm 9 (#1314)
Also replace `npm run` with `yarn` as it can't decide which version of
`npm` it should be using:
```js
import { spawnSync } from "node:child_process";
spawnSync("npm", ["--version"], { stdio: "inherit" });
```
```diff
diff --git a/package.json b/package.json
index 74e51fc..08b7730 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"lint:kt": "ktlint --android --relative 'android/app/src/**/*.kt'",
"lint:rb": "bundle exec rubocop",
"lint:swift": "swiftlint",
+ "npm-version": "node npm-version.mjs",
"prepack": "node scripts/pack.mjs pre",
"postpack": "node scripts/pack.mjs post",
"set-react-version": "node scripts/set-react-version.mjs",
```
```
% node npm-version.mjs
9.3.1
% yarn npm-version.mjs
9.3.1
% npm run npm-version
8.11.0
```
2023-02-16 16:29:58 +03:00
|
|
|
yarn semantic-release
|
2021-07-20 22:05:41 +03:00
|
|
|
autobot:
|
|
|
|
name: "Autobot"
|
2021-07-19 17:38:04 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
2024-06-17 14:11:52 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2021-07-19 17:38:04 +03:00
|
|
|
steps:
|
2021-07-20 22:05:41 +03:00
|
|
|
- name: Label
|
2024-01-02 12:32:11 +03:00
|
|
|
uses: actions/labeler@v5.0.0
|
2021-07-19 17:38:04 +03:00
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
sync-labels: true
|
2021-07-20 22:05:41 +03:00
|
|
|
continue-on-error: true
|