Skip to content

Commit

Permalink
[#498] Update workflows:
Browse files Browse the repository at this point in the history
- Change macOS-latest to self-hosted
- Add determine runner port step
- Update all fastlane steps with --swift_server_port ${{ env.runner_port }}
  • Loading branch information
ducbm051291 committed Jul 20, 2023
1 parent d754762 commit 3cab6c7
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 37 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/automatic_pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ concurrency:
jobs:
review_pull_request:
name: Pull request review by Danger
runs-on: macOS-latest
runs-on: self-hosted
steps:
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down Expand Up @@ -51,12 +62,12 @@ jobs:
run: bundle exec pod install

- name: Build and Test
run: bundle exec fastlane buildAndTest
env:
CI: true
run: |
bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }}
- name: Clean up previous code coverage report
run: bundle exec fastlane cleanUpOutput
run: |
bundle exec fastlane cleanUpOutput --swift_server_port ${{ env.runner_port }}
- name: Review pull request by Danger
env:
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/deploy_app_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,19 @@ jobs:

build:
name: Build
runs-on: macOS-latest
runs-on: self-hosted
steps:
- name: Determine Runner Port and Test Device
id: runner_port_test_device
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3
# Set fetch-depth (default: 1) to get whole tree
Expand Down Expand Up @@ -73,15 +84,18 @@ jobs:
shell: bash

- name: Build and Test
run: bundle exec fastlane buildAndTest
run: |
bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }}
- name: Match AppStore
run: bundle exec fastlane syncAppStoreCodeSigning
run: |
bundle exec fastlane syncAppStoreCodeSigning --swift_server_port ${{ env.runner_port }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- name: Build App and Distribute to AppStore
run: bundle exec fastlane buildAndUploadToAppStore
run: |
bundle exec fastlane buildAndUploadToAppStore --swift_server_port ${{ env.runner_port }}
env:
APPSTORE_CONNECT_API_KEY: ${{ secrets.APPSTORE_CONNECT_API_KEY }}
API_KEY_ID: ${{ secrets.API_KEY_ID }}
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/deploy_production_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,21 @@ jobs:

build:
name: Build
runs-on: macOS-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3
# Set fetch-depth (default: 1) to get whole tree
with:
fetch-depth: 0
Expand Down Expand Up @@ -70,15 +82,18 @@ jobs:
shell: bash

- name: Build and Test
run: bundle exec fastlane buildAndTest
run: |
bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }}
- name: Match Ad-hoc
run: bundle exec fastlane syncAdHocProductionCodeSigning
run: |
bundle exec fastlane syncAdHocProductionCodeSigning --swift_server_port ${{ env.runner_port }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- name: Build Production App and Distribute to Firebase
run: bundle exec fastlane buildProductionAndUploadToFirebase
run: |
bundle exec fastlane buildProductionAndUploadToFirebase --swift_server_port ${{ env.runner_port }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/deploy_staging_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,21 @@ jobs:

build:
name: Build
runs-on: macOS-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3
# Set fetch-depth (default: 1) to get whole tree
with:
fetch-depth: 0
Expand Down Expand Up @@ -76,15 +88,18 @@ jobs:
shell: bash

- name: Build and Test
run: bundle exec fastlane buildAndTest
run: |
bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }}
- name: Match Ad-hoc
run: bundle exec fastlane syncAdHocStagingCodeSigning
run: |
bundle exec fastlane syncAdHocStagingCodeSigning --swift_server_port ${{ env.runner_port }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- name: Build App and Distribute to Firebase
run: bundle exec fastlane buildStagingAndUploadToFirebase
run: |
bundle exec fastlane buildStagingAndUploadToFirebase --swift_server_port ${{ env.runner_port }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/test_swiftui_install_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,21 @@ concurrency:
jobs:
Test:
name: Test
runs-on: macOS-12
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3

- name: Bundle install
run: bundle install
Expand All @@ -22,6 +34,5 @@ jobs:
run: sh make.sh --bundle-id co.nimblehq.template --bundle-id-staging co.nimblehq.template.staging --project-name TemplateApp --interface SwiftUI

- name: Build and Test
run: bundle exec fastlane buildAndTest
env:
CI: true
run: |
bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }}
21 changes: 16 additions & 5 deletions .github/workflows/test_uikit_install_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,21 @@ concurrency:
jobs:
Test:
name: Test
runs-on: macOS-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3

- name: Bundle install
run: bundle install
Expand All @@ -22,6 +34,5 @@ jobs:
run: sh make.sh --bundle-id co.nimblehq.template --bundle-id-staging co.nimblehq.template.staging --project-name TemplateApp --interface UIKit

- name: Build and Test
run: bundle exec fastlane buildAndTest
env:
CI: true
run: |
bundle exec fastlane buildAndTest --swift_server_port ${{ env.runner_port }}
22 changes: 18 additions & 4 deletions .github/workflows/test_upload_build_to_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,19 @@ concurrency:
jobs:
build:
name: Build
runs-on: macOS-latest
runs-on: self-hosted
steps:
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -57,15 +68,18 @@ jobs:
TEAM_ID: ${{ secrets.TEAM_ID }}

- name: Set Up Test Project for Firebase
run: bundle exec fastlane setUpTestProject
run: |
bundle exec fastlane setUpTestProject --swift_server_port ${{ env.runner_port }}
- name: Sync Ad Hoc Code Signing
run: bundle exec fastlane syncAdHocStagingCodeSigning
run: |
bundle exec fastlane syncAdHocStagingCodeSigning --swift_server_port ${{ env.runner_port }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- name: Build App and Distribute to Firebase
run: bundle exec fastlane buildStagingAndUploadToFirebase
run: |
bundle exec fastlane buildStagingAndUploadToFirebase --swift_server_port ${{ env.runner_port }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/test_upload_build_to_test_flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ concurrency:
jobs:
build:
name: Build
runs-on: macOS-latest
runs-on: self-hosted
steps:
- name: Determine Runner Port
id: runner_port
run: |
last_char=$(echo "${{ runner.name }}" | tail -c 2 | head -c 1)
if [ "$last_char" = "1" ]; then
echo "runner_port=2000" >> $GITHUB_ENV
echo "test_device=iPhone 14 Pro Max" >> $GITHUB_ENV
else
echo "runner_port=2001" >> $GITHUB_ENV
echo "test_device=iPhone SE (3rd generation)" >> $GITHUB_ENV
fi
- name: Checkout Repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -55,15 +66,18 @@ jobs:
TEAM_ID: ${{ secrets.TEAM_ID }}

- name: Set Up Test Project for App Store
run: bundle exec fastlane setUpTestProject
run: |
bundle exec fastlane setUpTestProject --swift_server_port ${{ env.runner_port }}
- name: Sync App Store Code Signing
run: bundle exec fastlane syncAppStoreCodeSigning
run: |
bundle exec fastlane syncAppStoreCodeSigning --swift_server_port ${{ env.runner_port }}
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- name: Build App and Distribute to AppStore
run: bundle exec fastlane buildAndUploadToAppStore
run: |
bundle exec fastlane buildAndUploadToAppStore --swift_server_port ${{ env.runner_port }}
env:
APPSTORE_CONNECT_API_KEY: ${{ secrets.APPSTORE_CONNECT_API_KEY }}
API_KEY_ID: ${{ secrets.API_KEY_ID }}
Expand Down

0 comments on commit 3cab6c7

Please sign in to comment.