|
| 1 | +name: Integrate $(Date:yyyyMMdd).$(Rev:.r) |
| 2 | +variables: |
| 3 | + - template: variables/mac.yml |
| 4 | +trigger: |
| 5 | + branches: |
| 6 | + include: |
| 7 | + - master |
| 8 | + - '*-stable' |
| 9 | + paths: |
| 10 | + exclude: |
| 11 | + - '*.md' |
| 12 | +pr: |
| 13 | + branches: |
| 14 | + include: |
| 15 | + - master |
| 16 | + - '*-stable' |
| 17 | + paths: |
| 18 | + exclude: |
| 19 | + - '*.md' |
| 20 | +jobs: |
| 21 | + - job: react_native_test_app |
| 22 | + displayName: react-native-test-app |
| 23 | + pool: |
| 24 | + vmImage: $(VmImage) |
| 25 | + demands: ['npm', 'sh', 'xcode'] |
| 26 | + workspace: |
| 27 | + clean: all |
| 28 | + timeoutInMinutes: 60 |
| 29 | + cancelTimeoutInMinutes: 5 |
| 30 | + steps: |
| 31 | + - template: templates/apple-node-setup.yml |
| 32 | + - template: templates/apple-xcode-select.yml |
| 33 | + parameters: |
| 34 | + slice_name: $(slice_name) |
| 35 | + xcode_version: $(xcode_version) |
| 36 | + - bash: | |
| 37 | + echo "##vso[task.setvariable variable=package_version]$(cat package.json | jq .version | awk '{ print substr($0, 2, length($0) - 2) }')" |
| 38 | + echo "##vso[task.setvariable variable=react_version]$(cat package.json | jq .peerDependencies.react)" |
| 39 | + echo "##vso[task.setvariable variable=rncli_version]$(cat package.json | jq '.dependencies."@react-native-community/cli"')" |
| 40 | + displayName: 'Determine react-native-macos version' |
| 41 | + - bash: | |
| 42 | + npm pack |
| 43 | + displayName: 'Pack react-native-macos' |
| 44 | + - bash: | |
| 45 | + git clone --progress https://github.com/microsoft/react-native-test-app.git |
| 46 | + displayName: Checkout react-native-test-app |
| 47 | + - bash: | |
| 48 | + set -eo pipefail |
| 49 | + cat package.json | |
| 50 | + jq '.devDependencies["react"] = $(react_version)' | |
| 51 | + jq '.devDependencies["react-native"] = "^0.64"' | |
| 52 | + jq '.devDependencies["react-native-macos"] = "../react-native-macos-$(package_version).tgz"' | |
| 53 | + jq 'del(.devDependencies["@react-native-community/cli"])' | |
| 54 | + jq 'del(.devDependencies["@react-native-community/cli-platform-android"])' | |
| 55 | + jq 'del(.devDependencies["@react-native-community/cli-platform-ios"])' | |
| 56 | + jq 'del(.devDependencies["react-native-windows"])' > .package.json |
| 57 | + mv .package.json package.json |
| 58 | + cat package.json | jq .devDependencies |
| 59 | + displayName: Modify react-native-test-app dependencies |
| 60 | + workingDirectory: react-native-test-app |
| 61 | + - bash: | |
| 62 | + set -eo pipefail |
| 63 | + cat package.json | |
| 64 | + jq '.devDependencies["@react-native-community/cli"] = $(rncli_version)' | |
| 65 | + jq '.devDependencies["@react-native-community/cli-platform-android"] = $(rncli_version)' | |
| 66 | + jq '.devDependencies["@react-native-community/cli-platform-ios"] = $(rncli_version)' | |
| 67 | + jq '.devDependencies["react"] = $(react_version)' | |
| 68 | + jq '.devDependencies["react-native"] = "^0.64"' | |
| 69 | + jq '.devDependencies["react-native-macos"] = "../../react-native-macos-$(package_version).tgz"' | |
| 70 | + jq 'del(.devDependencies["react-native-windows"])' > .package.json |
| 71 | + mv .package.json package.json |
| 72 | + cat package.json | jq .devDependencies |
| 73 | + displayName: Modify example app dependencies |
| 74 | + workingDirectory: react-native-test-app/example |
| 75 | + - bash: | |
| 76 | + yarn --no-immutable |
| 77 | + displayName: Install npm dependencies |
| 78 | + workingDirectory: react-native-test-app |
| 79 | + - bash: | |
| 80 | + yarn build:macos || yarn build:macos |
| 81 | + displayName: Bundle JavaScript |
| 82 | + workingDirectory: react-native-test-app/example |
| 83 | + - bash: | |
| 84 | + pod install --project-directory=macos |
| 85 | + displayName: Install Pods |
| 86 | + workingDirectory: react-native-test-app/example |
| 87 | + - bash: | |
| 88 | + set -eo pipefail |
| 89 | + ../scripts/xcodebuild.sh macos/Example.xcworkspace build |
| 90 | + displayName: Build Intel |
| 91 | + workingDirectory: react-native-test-app/example |
| 92 | + - bash: | |
| 93 | + set -eo pipefail |
| 94 | + ../scripts/xcodebuild.sh macos/Example.xcworkspace clean |
| 95 | + ../scripts/xcodebuild.sh macos/Example.xcworkspace build ARCHS=arm64 |
| 96 | + displayName: Build ARM |
| 97 | + workingDirectory: react-native-test-app/example |
0 commit comments