Skip to content

Commit 2663345

Browse files
committed
fix output
1 parent 5fd44ad commit 2663345

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

.github/workflows/build-sample-app.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ on:
1616
description: "SDK version to use (optional, defaults to local dependency)"
1717
required: false
1818
type: string
19+
outputs:
20+
sdk_version_name:
21+
description: "SDK version used in the build"
22+
value: ${{ jobs.build.outputs.sdk_version_name }}
23+
app_version_name:
24+
description: "Generated app version name"
25+
value: ${{ jobs.build.outputs.app_version_name }}
26+
app_version_code:
27+
description: "Generated app version code"
28+
value: ${{ jobs.build.outputs.app_version_code }}
1929

2030
env:
2131
XCODE_VERSION: "15.3"
@@ -24,11 +34,15 @@ env:
2434

2535
jobs:
2636
build-sample-app:
37+
name: Building sample app ${{ inputs.app_name }} with SDK version ${{ inputs.sdk_version }}
38+
runs-on: macos-14
2739
defaults:
2840
run:
2941
working-directory: Apps/${{ inputs.app_name }} # sets working directory for all steps in this job
30-
runs-on: macos-14
31-
name: Building sample app ${{ inputs.app_name }} with SDK version ${{ inputs.sdk_version }}
42+
outputs:
43+
sdk_version_name: ${{ steps.export-vars.outputs.sdk_version_name }}
44+
app_version_name: ${{ steps.export-vars.outputs.app_version_name }}
45+
app_version_code: ${{ steps.export-vars.outputs.app_version_code }}
3246

3347
steps:
3448
- name: Check out code with conditional fetch-depth
@@ -85,6 +99,13 @@ jobs:
8599
lane: "generate_new_version"
86100
options: '{"branch_name":"${{ github.ref_name }}", "pull_request_number":"${{ github.event.pull_request.number }}", "sdk_version":"${{ inputs.sdk_version }}"}'
87101

102+
- name: Export App and SDK Version Info
103+
id: export-vars
104+
run: |
105+
echo "sdk_version_name=${{ env.SDK_VERSION_NAME }}" >> $GITHUB_OUTPUT
106+
echo "app_version_name=${{ env.APP_VERSION_NAME }}" >> $GITHUB_OUTPUT
107+
echo "app_version_code=${{ env.APP_VERSION_CODE }}" >> $GITHUB_OUTPUT
108+
88109
- name: Update React Native SDK Version
89110
uses: maierj/fastlane-action@v3.1.0
90111
with:

.github/workflows/build-test-sample-apps.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
runs-on: ubuntu-latest
7070
permissions:
7171
pull-requests: write # to be able to comment on PR
72+
strategy:
73+
matrix:
74+
sample-app:
75+
- name: "APN"
76+
- name: "FCM"
7277
steps:
7378
- name: Update sample builds PR comment with build information
7479
if: ${{ github.event_name == 'pull_request' }}
@@ -78,7 +83,7 @@ jobs:
7883
issue-number: ${{ github.event.pull_request.number }}
7984
# the variables APP_VERSION_NAME, APP_VERSION_CODE are generated above in generate_new_version lane
8085
body: |
81-
* ${{ matrix.sample-app.name }}: `${{ env.APP_VERSION_NAME }} (${{ env.APP_VERSION_CODE }})`
86+
* ${{ matrix.sample-app.name }}: `${{ needs.build-sample-apps.outputs.app_version_name }} (${{ needs.build-sample-apps.outputs.app_version_code }})`
8287
edit-mode: append # append new line to the existing PR comment to build a list of all sample app builds.
8388

8489
- name: Update sample builds PR comment with build failure message

0 commit comments

Comments
 (0)