Skip to content

Commit

Permalink
fastlane-version input (#20)
Browse files Browse the repository at this point in the history
* feat: add 'fastlane-version' input, unified 'fastlane' using bundler

---------

Co-authored-by: Antonio Barile <[email protected]>
  • Loading branch information
abarnto and abarnto authored May 30, 2023
1 parent 5f67a40 commit 4fb7434
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 16 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Change Log

## [2.1.0] - 2023-01-30
## [2.3.0] - 2023-26-05

### Added

`fastlane-version` input.

### Changed

Fastlane is always installed via `bundler`.

## [2.2.0] - 2023-21-02

### Changed

Remove `include_bitcode` parameter (now deprecated).

## [2.1.0] - 2023-30-01

### Added

Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
source 'https://rubygems.org'

gem 'cocoapods'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval(File.read(plugins_path), binding) if File.exist?(plugins_path)
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ Browserstack username (**required if** browserstack-upload == true)

Browserstack access key (**required if** browserstack-upload == true)

### `fastlane-version`

Fastlane version to be used. If not specified, the default value will be used.

### `fastlane-env`

Name of the env file name to pass to `fastlane --env`
Expand All @@ -121,7 +125,7 @@ If you have any other inputs you'd like to add, feel free to create PR.
## Example usage with a production build uploaded to App Store

```yaml
- uses: sparkfabrik/ios-build-action@v2.1.0
- uses: sparkfabrik/ios-build-action@v2.3.0
with:
upload-to-testflight: true
increment-build-number: true
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ inputs:
description: "Browserstack access key (required if browserstack-upload == true)"
required: false
default: ""
fastlane-version:
description: "Specify the Fastlane version you wish to use"
default: "2.213.0"
required: false
fastlane-env:
description: "Name of the env file name to pass to fastlane --env"
required: false
Expand Down
16 changes: 6 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#!/bin/bash -e

if ! type fastlane > /dev/null 2>&1; then
if type brew > /dev/null 2>&1; then
brew install fastlane
else
sudo gem install fastlane -NV
fi
fi

script_path=$(cd $(dirname ${0}); pwd)
cp -r ${script_path}/fastlane ./
cp -r ${script_path}/Gemfile ./
cp ${script_path}/Gemfile ./

bundle add fastlane --version ${FASTLANE_VERSION}

if [[ $BROWSERSTACK_UPLOAD = true || $BUILD_PODS = true ]]; then
bundle install
bundle add cocoapods
fi

bundle install

# If the variable FASTLANE_ENV is set then run fastlane with the --env equal to the variable.
if [ -n "${FASTLANE_ENV}" ]; then
echo "Running fastlane with environment: ${FASTLANE_ENV}"
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,7 @@ async function run() {
process.env.APPLE_KEY_ID = core.getInput("apple-key-id");
process.env.APPLE_KEY_ISSUER_ID = core.getInput("apple-key-issuer-id");
process.env.APPLE_KEY_CONTENT = core.getInput("apple-key-content");
process.env.FASTLANE_VERSION = core.getInput("fastlane-version");
process.env.FASTLANE_ENV = core.getInput("fastlane-env");
process.env.IOS_APP_ID = core.getInput("ios-app-id");
await exec.exec(`bash ${__dirname}/../build.sh`);
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function run() {
process.env.APPLE_KEY_ID = core.getInput("apple-key-id");
process.env.APPLE_KEY_ISSUER_ID = core.getInput("apple-key-issuer-id");
process.env.APPLE_KEY_CONTENT = core.getInput("apple-key-content");
process.env.FASTLANE_VERSION = core.getInput("fastlane-version");
process.env.FASTLANE_ENV = core.getInput("fastlane-env");
process.env.IOS_APP_ID = core.getInput("ios-app-id");
await exec.exec(`bash ${__dirname}/../build.sh`);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spark-ios-build-action",
"version": "2.1.0",
"version": "2.3.0",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -18,4 +18,4 @@
"devDependencies": {
"@vercel/ncc": "0.34.0"
}
}
}

0 comments on commit 4fb7434

Please sign in to comment.