Skip to content

Commit

Permalink
Merge pull request #95 from luke-rogers/master
Browse files Browse the repository at this point in the history
feat: input for incrementing the build number
  • Loading branch information
yukiarrr authored Apr 6, 2023
2 parents 3b80eed + 13c1980 commit 645dc08
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ The SDK that should be used for building the application. Default `""`. For exam

Use a custom destination for building the app. Default `""`. For example, `"generic/platform=iOS"`.

### `increment-build-number`

Automatically increment the build number by one before building the application. Default `false`.

## Contributions Welcome!

If you have any other inputs you'd like to add, feel free to create PR.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ inputs:
description: "Path to your entitlements file"
required: false
default: ""
increment-build-number:
description: "Automatically increment the build number by one before building the application"
required: false
default: false
runs:
using: "node12"
main: "dist/index.js"
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function run() {
process.env.BUILD_SDK = core.getInput("build-sdk");
process.env.BUILD_DESTINATION = core.getInput("build-destination");
process.env.ENTITLMENTS_FILE_PATH = core.getInput("entitlements-file-path");
process.env.INCREMENT_BUILD_NUMBER = core.getInput("increment-build-number");

// Execute build.sh
await exec.exec(`bash ${__dirname}/../build.sh`);
Expand Down
7 changes: 7 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ platform :ios do
use_build_sdk = !ENV['BUILD_SDK'].empty?
use_build_destination = !ENV['BUILD_DESTINATION'].empty?
use_cloned_source_packages_path = !ENV['CLONED_SOURCE_PACKAGES_PATH'].empty?

if ENV['INCREMENT_BUILD_NUMBER'] == "true"
increment_build_number(
xcodeproj: ENV['PROJECT_PATH']
)
end

build_app(
workspace: use_workspace ? ENV['WORKSPACE_PATH'] : nil,
project: !use_workspace ? ENV['PROJECT_PATH'] : nil,
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async function run() {
process.env.BUILD_SDK = core.getInput("build-sdk");
process.env.BUILD_DESTINATION = core.getInput("build-destination");
process.env.ENTITLMENTS_FILE_PATH = core.getInput("entitlements-file-path");
process.env.INCREMENT_BUILD_NUMBER = core.getInput("increment-build-number");

// Execute build.sh
await exec.exec(`bash ${__dirname}/../build.sh`);
Expand Down

0 comments on commit 645dc08

Please sign in to comment.