Skip to content

Commit 728b539

Browse files
abarntoedodusi
andauthored
Feature/17 provisioning profiles (#18)
Co-authored-by: Edoardo Dusi <edo@edoardodusi.com> Co-authored-by: Antonio Barile <antonio.barile@sparkfabrik.com>
1 parent ed6c048 commit 728b539

File tree

8 files changed

+56
-29
lines changed

8 files changed

+56
-29
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Change Log
22

3+
## [2.1.0] - 2023-01-30
4+
5+
### Added
6+
7+
- `fastlane-env` (optional) input: Name of the env file name to pass to fastlane --env
8+
- `ios-app-id` (optional) input: The iOS application identifier; useful to sync a specific provisioning profile
9+
310
## [2.0.0] - 2022-10-06
4-
11+
512
Redesign of the Fastlane build and certificate handling.
613

714
### Breaking
815

9-
- This version uses `Match` so you cannot use base64 version of the certificates, instead you need to have a GitHub repo that match will use to store the certificates and an Apple app key. Follow the README to see the new parameters list.
16+
- This version uses `Match` so you cannot use base64 version of the certificates, instead you need to have a GitHub repo that match will use to store the certificates and an Apple app key. Follow the README to see the new parameters list.

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,29 @@ Browserstack username (**required if** browserstack-upload == true)
104104

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

107+
### `fastlane-env`
108+
109+
Name of the env file name to pass to `fastlane --env`
110+
111+
### `ios-app-id`
112+
113+
The iOS application identifier; useful to sync a specific provisioning profile
114+
107115
## Contributions Welcome!
108116

109117
If you have any other inputs you'd like to add, feel free to create PR.
110-
Remember to run `yarn install` and `yarn bundle` if you make changes to the `index.js`.
118+
119+
**NOTE:** Remember to run `yarn install` and `yarn bundle` if you make changes to the `index.js`.
111120

112121
## Example usage with a production build uploaded to App Store
113122

114123
```yaml
115-
- uses: sparkfabrik/ios-build-action@v2.0.0
124+
- uses: sparkfabrik/ios-build-action@v2.1.0
116125
with:
117126
upload-to-testflight: true
118127
increment-build-number: true
119128
build-pods: true
120-
pods-path: 'ios/Podfile'
129+
pods-path: "ios/Podfile"
121130
configuration: Release
122131
export-method: app-store
123132
workspace-path: ${{ secrets.WORKSPACE_PATH }}
@@ -132,8 +141,10 @@ Remember to run `yarn install` and `yarn bundle` if you make changes to the `ind
132141
match-password: ${{ secrets.MATCH_PASSWORD }}
133142
match-git-url: ${{ secrets.MATCH_GIT_URL }}
134143
match-git-basic-authorization: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
135-
match-build-type: 'appstore'
144+
match-build-type: "appstore"
136145
browserstack-upload: true
137146
browserstack-username: ${{ secrets.BROWSERSTACK_USERNAME }}
138147
browserstack-access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
148+
fastlane-env: stage
149+
ios-app-id: com.identifier.my_app
139150
```

action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,15 @@ inputs:
6666
match-password:
6767
description: "The password to decrypt certificates."
6868
required: true
69-
default: false
7069
match-git-url:
7170
description: "The git url where match can find the certificates."
7271
required: true
73-
default: false
7472
match-git-basic-authorization:
7573
description: "The basic authorization to access the repository."
7674
required: true
77-
default: false
7875
match-build-type:
7976
description: "The build type to use when building the app."
8077
required: true
81-
default: false
8278
browserstack-upload:
8379
description: "Boolean to tell the Action to upload the .ipa to Browserstack App Live after the build."
8480
required: false
@@ -91,6 +87,13 @@ inputs:
9187
description: "Browserstack access key (required if browserstack-upload == true)"
9288
required: false
9389
default: ""
90+
fastlane-env:
91+
description: "Name of the env file name to pass to fastlane --env"
92+
required: false
93+
default: ""
94+
ios-app-id:
95+
description: "The iOS application identifier; useful to sync a specific provisioning profile"
96+
required: false
9497
runs:
9598
using: "node16"
9699
main: "dist/index.js"

build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ if [[ $BROWSERSTACK_UPLOAD = true || $BUILD_PODS = true ]]; then
1616
bundle install
1717
fi
1818

19-
fastlane build
19+
# If the variable FASTLANE_ENV is set then run fastlane with the --env equal to the variable.
20+
if [ -n "${FASTLANE_ENV}" ]; then
21+
echo "Running fastlane with environment: ${FASTLANE_ENV}"
22+
fastlane --env ${FASTLANE_ENV} build
23+
else
24+
echo "Running fastlane"
25+
fastlane build
26+
fi

dist/index.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,8 +3333,7 @@ async function run() {
33333333
try {
33343334
if (
33353335
core.getInput("browserstack-upload").toLowerCase() === "true" &&
3336-
(!core.getInput("browserstack-username") ||
3337-
!core.getInput("browserstack-access-key"))
3336+
(!core.getInput("browserstack-username") || !core.getInput("browserstack-access-key"))
33383337
) {
33393338
throw new Error("Browserstack username or access key missing.");
33403339
}
@@ -3350,20 +3349,18 @@ async function run() {
33503349
process.env.SCHEME = core.getInput("scheme");
33513350
process.env.BROWSERSTACK_UPLOAD = core.getInput("browserstack-upload");
33523351
process.env.BROWSERSTACK_USERNAME = core.getInput("browserstack-username");
3353-
process.env.BROWSERSTACK_ACCESS_KEY = core.getInput(
3354-
"browserstack-access-key"
3355-
);
3352+
process.env.BROWSERSTACK_ACCESS_KEY = core.getInput("browserstack-access-key");
33563353
process.env.BUILD_PODS = core.getInput("build-pods");
33573354
process.env.PODS_PATH = core.getInput("pods-path");
33583355
process.env.MATCH_PASSWORD = core.getInput("match-password");
33593356
process.env.MATCH_GIT_URL = core.getInput("match-git-url");
3360-
process.env.MATCH_GIT_BASIC_AUTHORIZATION = core.getInput(
3361-
"match-git-basic-authorization"
3362-
);
3357+
process.env.MATCH_GIT_BASIC_AUTHORIZATION = core.getInput("match-git-basic-authorization");
33633358
process.env.MATCH_BUILD_TYPE = core.getInput("match-build-type");
33643359
process.env.APPLE_KEY_ID = core.getInput("apple-key-id");
33653360
process.env.APPLE_KEY_ISSUER_ID = core.getInput("apple-key-issuer-id");
33663361
process.env.APPLE_KEY_CONTENT = core.getInput("apple-key-content");
3362+
process.env.FASTLANE_ENV = core.getInput("fastlane-env");
3363+
process.env.IOS_APP_ID = core.getInput("ios-app-id");
33673364
await exec.exec(`bash ${__dirname}/../build.sh`);
33683365
} catch (error) {
33693366
core.setFailed(error.message);

fastlane/Fastfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ platform :ios do
5555
export_team_id: ENV['TEAM_ID'],
5656
silent: true,
5757
include_bitcode: true,
58+
export_options: ENV['IOS_APP_ID'] != nil ? {
59+
provisioningProfiles: {
60+
"#{ENV['IOS_APP_ID']}" => "match AppStore #{ENV['IOS_APP_ID']}",
61+
},
62+
} : nil
5863
)
5964

6065
if ENV["BROWSERSTACK_UPLOAD"] == 'true'

index.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ async function run() {
55
try {
66
if (
77
core.getInput("browserstack-upload").toLowerCase() === "true" &&
8-
(!core.getInput("browserstack-username") ||
9-
!core.getInput("browserstack-access-key"))
8+
(!core.getInput("browserstack-username") || !core.getInput("browserstack-access-key"))
109
) {
1110
throw new Error("Browserstack username or access key missing.");
1211
}
@@ -22,20 +21,18 @@ async function run() {
2221
process.env.SCHEME = core.getInput("scheme");
2322
process.env.BROWSERSTACK_UPLOAD = core.getInput("browserstack-upload");
2423
process.env.BROWSERSTACK_USERNAME = core.getInput("browserstack-username");
25-
process.env.BROWSERSTACK_ACCESS_KEY = core.getInput(
26-
"browserstack-access-key"
27-
);
24+
process.env.BROWSERSTACK_ACCESS_KEY = core.getInput("browserstack-access-key");
2825
process.env.BUILD_PODS = core.getInput("build-pods");
2926
process.env.PODS_PATH = core.getInput("pods-path");
3027
process.env.MATCH_PASSWORD = core.getInput("match-password");
3128
process.env.MATCH_GIT_URL = core.getInput("match-git-url");
32-
process.env.MATCH_GIT_BASIC_AUTHORIZATION = core.getInput(
33-
"match-git-basic-authorization"
34-
);
29+
process.env.MATCH_GIT_BASIC_AUTHORIZATION = core.getInput("match-git-basic-authorization");
3530
process.env.MATCH_BUILD_TYPE = core.getInput("match-build-type");
3631
process.env.APPLE_KEY_ID = core.getInput("apple-key-id");
3732
process.env.APPLE_KEY_ISSUER_ID = core.getInput("apple-key-issuer-id");
3833
process.env.APPLE_KEY_CONTENT = core.getInput("apple-key-content");
34+
process.env.FASTLANE_ENV = core.getInput("fastlane-env");
35+
process.env.IOS_APP_ID = core.getInput("ios-app-id");
3936
await exec.exec(`bash ${__dirname}/../build.sh`);
4037
} catch (error) {
4138
core.setFailed(error.message);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spark-ios-build-action",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
@@ -18,4 +18,4 @@
1818
"devDependencies": {
1919
"@vercel/ncc": "0.34.0"
2020
}
21-
}
21+
}

0 commit comments

Comments
 (0)