Skip to content

Commit

Permalink
feat: upgrade nitro CLI version
Browse files Browse the repository at this point in the history
Bitrise Step updates:
- Add the --output-format=json to the step to set envs using
envman from this step
- Do not throw till the end to be able to set envs from the json output

Nitro CLI change log:
- Remove envman dependency
- Fix an issue when parsing output .apk files
- Add support for Yarn 3
- Fix incorrect ANDROID_HOME error throwing for iOS builds
- Add missing pipefail to xcodebuild command
  • Loading branch information
jpgarcia committed Jan 28, 2023
1 parent d719d42 commit c180211
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 177 deletions.
86 changes: 43 additions & 43 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,135 +5,135 @@

* improve xcbeautify command detection ([524e74a](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/524e74a6569f78d1cc1c003ef8671179bc736cfe))

# [4.4.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.3.0...4.4.0) (2023-01-05)
## [4.4.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.3.0...4.4.0) (2023-01-05)


### Features

* detox + iOS simulator support ([#3](https://github.com/nitro-build/bitrise-step-nitro-ios/issues/3)) ([a86877e](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/a86877eae9ed4c0d2585e8643c0d2fe463e69c31))

# [4.3.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.1...4.3.0) (2022-12-19)
## [4.3.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.1...4.3.0) (2022-12-19)

### Features

- add arguments to specify custom s3 cache provider config ([8a9cf9d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8a9cf9d182dbb02d710c0e5be968c139bfe5660a))
* add arguments to specify custom s3 cache provider config ([8a9cf9d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8a9cf9d182dbb02d710c0e5be968c139bfe5660a))

# [4.3.0-beta.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.1...4.3.0-beta.1) (2022-12-19)
## [4.3.0-beta.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.1...4.3.0-beta.1) (2022-12-19)

### Features

- add arguments to specify custom s3 cache provider config ([8a9cf9d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8a9cf9d182dbb02d710c0e5be968c139bfe5660a))
* add arguments to specify custom s3 cache provider config ([8a9cf9d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8a9cf9d182dbb02d710c0e5be968c139bfe5660a))

## [4.2.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.0...4.2.1) (2022-12-06)
### [4.2.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.2.0...4.2.1) (2022-12-06)

### Bug Fixes

- declare missing system dependency ([2f43fc5](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2f43fc5d8cb86284fdcf7e50471ca900f354cef6))
* declare missing system dependency ([2f43fc5](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2f43fc5d8cb86284fdcf7e50471ca900f354cef6))

# [4.2.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.1.0...4.2.0) (2022-12-01)
## [4.2.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.1.0...4.2.0) (2022-12-01)

### Bug Fixes

- change website to Github url ([4c9eff3](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/4c9eff32127ae14d9f05b29ab9c79b74a8936bc4))
* change website to Github url ([4c9eff3](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/4c9eff32127ae14d9f05b29ab9c79b74a8936bc4))

### Features

- add icon and modify metadata ([049fecf](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/049fecfd6039c7075d3ae8a5fbde3fe5a7daaf54))
* add icon and modify metadata ([049fecf](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/049fecfd6039c7075d3ae8a5fbde3fe5a7daaf54))

# [4.1.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0...4.1.0) (2022-12-01)
## [4.1.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0...4.1.0) (2022-12-01)

### Features

- add missing parameter and default values ([ed97533](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/ed97533a4cdf415ef583b5de2cfd170650e32750))
* add missing parameter and default values ([ed97533](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/ed97533a4cdf415ef583b5de2cfd170650e32750))

# [4.0.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/3.0.0...4.0.0) (2022-11-04)
## [4.0.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/3.0.0...4.0.0) (2022-11-04)

### Features

- point to the latest nitro version ([2af9e0d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2af9e0d22698cf7cd44a26ee4c3513fa41b3803a))
- update nitro to the latest version ([fcb2504](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/fcb2504ff489c0323cc33353fcea6d8c162db0bf))
- update to the latest nitro version ([22034bb](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/22034bb75b5073e7d1ec45870efb2961a11d70d4))
- update to the latest nitro version ([2d12a4a](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2d12a4a9fefaaf534537270a6bb30a57005983a5))
* point to the latest nitro version ([2af9e0d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2af9e0d22698cf7cd44a26ee4c3513fa41b3803a))
* update nitro to the latest version ([fcb2504](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/fcb2504ff489c0323cc33353fcea6d8c162db0bf))
* update to the latest nitro version ([22034bb](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/22034bb75b5073e7d1ec45870efb2961a11d70d4))
* update to the latest nitro version ([2d12a4a](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2d12a4a9fefaaf534537270a6bb30a57005983a5))

### BREAKING CHANGES

- remove ios prefix
* remove ios prefix

# [4.0.0-beta.4](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0-beta.3...4.0.0-beta.4) (2022-11-04)
## [4.0.0-beta.4](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0-beta.3...4.0.0-beta.4) (2022-11-04)

### Features

- update to the latest nitro version ([22034bb](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/22034bb75b5073e7d1ec45870efb2961a11d70d4))
* update to the latest nitro version ([22034bb](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/22034bb75b5073e7d1ec45870efb2961a11d70d4))

# [4.0.0-beta.3](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0-beta.2...4.0.0-beta.3) (2022-11-04)
## [4.0.0-beta.3](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0-beta.2...4.0.0-beta.3) (2022-11-04)

### Features

- update to the latest nitro version ([2d12a4a](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2d12a4a9fefaaf534537270a6bb30a57005983a5))
* update to the latest nitro version ([2d12a4a](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2d12a4a9fefaaf534537270a6bb30a57005983a5))

# [4.0.0-beta.2](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0-beta.1...4.0.0-beta.2) (2022-11-04)
## [4.0.0-beta.2](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/4.0.0-beta.1...4.0.0-beta.2) (2022-11-04)

### Features

- point to the latest nitro version ([2af9e0d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2af9e0d22698cf7cd44a26ee4c3513fa41b3803a))
* point to the latest nitro version ([2af9e0d](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/2af9e0d22698cf7cd44a26ee4c3513fa41b3803a))

# [4.0.0-beta.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/3.0.0...4.0.0-beta.1) (2022-11-04)
## [4.0.0-beta.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/3.0.0...4.0.0-beta.1) (2022-11-04)

### Features

- update nitro to the latest version ([fcb2504](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/fcb2504ff489c0323cc33353fcea6d8c162db0bf))
* update nitro to the latest version ([fcb2504](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/fcb2504ff489c0323cc33353fcea6d8c162db0bf))

### BREAKING CHANGES

- remove ios prefix
* remove ios prefix

# [3.0.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/2.0.0...3.0.0) (2022-10-27)
## [3.0.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/2.0.0...3.0.0) (2022-10-27)

### Features

- update to the latest nitro version ([d19dae1](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/d19dae151ec3e5a8c467e3c7afbde5fddfae0cfd))
* update to the latest nitro version ([d19dae1](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/d19dae151ec3e5a8c467e3c7afbde5fddfae0cfd))

### BREAKING CHANGES

- support for api-key and offline license
* support for api-key and offline license

# [2.0.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.2.0...2.0.0) (2022-10-25)
## [2.0.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.2.0...2.0.0) (2022-10-25)

### Features

- improve args ([8179a39](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8179a398639c669d7734a1ec52e481e1525631e7))
* improve args ([8179a39](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/8179a398639c669d7734a1ec52e481e1525631e7))

### BREAKING CHANGES

- remove ios prefix to the args
* remove ios prefix to the args

# [1.2.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.1.2...1.2.0) (2022-10-24)
## [1.2.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.1.2...1.2.0) (2022-10-24)

### Features

- add verbose argument ([069d089](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/069d089d7b257bb103e4330ec5ee5055ecbca7db))
- upgrade nitro version ([b30296c](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/b30296cd136275753d9aaa333b97194d4e973a7f))
* add verbose argument ([069d089](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/069d089d7b257bb103e4330ec5ee5055ecbca7db))
* upgrade nitro version ([b30296c](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/b30296cd136275753d9aaa333b97194d4e973a7f))

## [1.1.2](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.1.1...1.1.2) (2022-10-13)
### [1.1.2](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.1.1...1.1.2) (2022-10-13)

### Bug Fixes

- apktool injection issue ([3b59078](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/3b590780890db9f185fb87db8dd8ed8a21fb625e))
* apktool injection issue ([3b59078](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/3b590780890db9f185fb87db8dd8ed8a21fb625e))

## [1.1.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.1.0...1.1.1) (2022-10-12)
### [1.1.1](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.1.0...1.1.1) (2022-10-12)

### Bug Fixes

- remove defaults not required ([526207f](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/526207fd7ff8cab64e9893d665857fd3c24f8741))
* remove defaults not required ([526207f](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/526207fd7ff8cab64e9893d665857fd3c24f8741))

# [1.1.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.0.0...1.1.0) (2022-10-05)
## [1.1.0](https://github.com/nitro-build/bitrise-step-nitro-ios/compare/1.0.0...1.1.0) (2022-10-05)

### Features

- update bitrise stack ([265cdd6](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/265cdd6aaec7e78b866522b4bd8e0321f4b8cd28))
* update bitrise stack ([265cdd6](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/265cdd6aaec7e78b866522b4bd8e0321f4b8cd28))

# 1.0.0 (2022-09-12)

### Features

- initial commit ([cf56114](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/cf56114a159fb9a69362d2391d5b5fe20182c6d9))
* initial commit ([cf56114](https://github.com/nitro-build/bitrise-step-nitro-ios/commit/cf56114a159fb9a69362d2391d5b5fe20182c6d9))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@semantic-release/exec": "6.0.3",
"@semantic-release/git": "10.0.1",
"semantic-release": "19.0.5",
"nitro": "ssh://[email protected]:nitro-build/nitro.git#0.8.1"
"nitro": "ssh://[email protected]:nitro-build/nitro.git#develop"
},
"devDependencies": {
"@commitlint/cli": "17.3.0",
Expand Down
37 changes: 28 additions & 9 deletions step.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/bin/bash
set -e

# Do not exit on errors. If "safe mode" is not enabled it will exit properly at the end.
set +e

# ----------------------
# Advanced configuration
# ----------------------

# shellcheck disable=SC2154
if [[ "${fail_safe}" == "true" || "${fail_safe}" == "yes" ]]; then
set +e
fi

# shellcheck disable=SC2154
if [[ "${debug}" == "true" || "${debug}" == "yes" ]]; then
set -x
Expand All @@ -31,6 +28,7 @@ export NITRO_BOOTED_AT_TIMESTAMP="${bitrise_process_started_at_ms}"

# Build command arguments
args=("ios")
args+=("--output-format" "json")
args+=("--tracking-provider" "nitro-on-premise")

args+=("--build-id" "${BITRISE_BUILD_SLUG}")
Expand Down Expand Up @@ -199,6 +197,7 @@ LINUX_BIN_FILE="nitro-linux"

BIN_FILE=$([[ "$(uname)" == "Darwin" ]] && echo "${MACOS_BIN_FILE}" || echo "${LINUX_BIN_FILE}")
BIN_FILE_PATH="${SCRIPT_DIR}/nitro"
NITRO_OUTPUT_JSON_PATH="$(pwd)/nitro-output.json"

# Download cli release
wget -q "https://github.com/nitro-build/bitrise-step-nitro-ios/releases/download/${BITRISE_STEP_VERSION}/${BIN_FILE}" -O "${BIN_FILE_PATH}"
Expand All @@ -207,11 +206,31 @@ ${BIN_FILE_PATH} "${args[@]}"

exit_code=$?

# Set environment variables using envman
if [[ exit_code -ne 0 ]]; then
echo "⚠️ Nitro has thrown a '${exit_code}' error code while running on fail-safe mode. You can check 'NITRO_BUILD_FAILED' value in further steps."
envman add --key "NITRO_BUILD_FAILED" --value "true"
envman add --key "NITRO_BUILD_STATUS" --value "failed"
else
envman add --key "NITRO_BUILD_FAILED" --value "false"
envman add --key "NITRO_BUILD_STATUS" --value "success"
fi

if [ -f "${NITRO_OUTPUT_JSON_PATH}" ]; then
output=$(cat < "${NITRO_OUTPUT_JSON_PATH}")

echo "${output}" | jq -r '.appPath' | xargs -I{} echo -n {} | envman add --key NITRO_APP_PATH
echo "${output}" | jq -r '.outputDir' | xargs -I{} echo -n {} | envman add --key NITRO_OUTPUT_DIR
echo "${output}" | jq -r '.summaryPath' | xargs -I{} echo -n {} | envman add --key NITRO_SUMMARY_PATH
echo "${output}" | jq -r '.logsPath' | xargs -I{} echo -n {} | envman add --key NITRO_LOGS_PATH
else
echo "File not found: ${NITRO_OUTPUT_JSON_PATH}"
fi

# shellcheck disable=SC2154
if [[ "${fail_safe}" == "true" || "${fail_safe}" == "yes" ]]; then
if [[ exit_code -ne 0 ]]; then
echo "⚠️ Nitro has thrown a '${exit_code}' error code while running on fail-safe mode. You can check 'NITRO_BUILD_STATUS' value in further steps."
fi
else
# If not running in "safe mode" exit with captured exit_code
set -e
exit $exit_code
fi
9 changes: 9 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ inputs:
value_options:
- "yes"
- "no"
- debug: "no"
opts:
category: "Advanced"
title: "Debug step"
summary: "Enable step debugging"
description: "Enable step debugging"
value_options:
- "yes"
- "no"
- fail_safe: "$NITRO_FAIL_SAFE"
opts:
category: "Advanced"
Expand Down
Loading

0 comments on commit c180211

Please sign in to comment.