Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: submit on ios on workflow dispatch #537

Merged
merged 5 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion .github/workflows/beta_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ name: 'publish beta'

on:
workflow_dispatch:
inputs:
platform:
description: 'Select platform(s) to build'
required: true
default: 'both'
type: choice
options:
- android
- ios
- both

jobs:
tests:
Expand All @@ -12,7 +22,8 @@ jobs:
user-password: ${{ vars.USER_PASSWORD }}
user-seed: ${{ vars.USER_SEED }}

distribute:
distribute_android:
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'both' }}
uses: ./.github/workflows/distribute.yml
needs: tests
with:
Expand All @@ -24,4 +35,56 @@ jobs:
keystore-alias: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
keystore-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}
keystore-key-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}

distribute_ios:
runs-on: macOS-latest
if: ${{ github.event.inputs.platform == 'ios' || github.event.inputs.platform == 'both' }}
needs: tests
steps:
- uses: dyne/pnpm@main
with:
node-version: '20.11.1'
submodules: true
- name: Set env
run: echo "PUBLIC_BACKEND_URL=${{vars.PUBLIC_BACKEND_URL}}" >> $GITHUB_ENV
- name: Install dependencies
id: install_code
run: pnpm install
- name: Build
id: build_code
run: pnpm build
- uses: actions/cache@v3
with:
path: ios/App/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Sync
id: sync_code
run: pnpm cap sync ios
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }}
BUNDLE_IDENTIFIER: ${{ secrets.BUNDLE_IDENTIFIER }}
BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_BUILD_CERTIFICATE }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.IOS_BUILD_PROVISION_PROFILE }}
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}
APPLE_PROFILE_NAME: ${{ secrets.APPLE_PROFILE_NAME }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
DEMO_USER: ${{ vars.USER_EMAIL }}
DEMO_PASSWORD: ${{ vars.USER_PASSWORD }}
with:
lane: ios production
- name: Upload release bundle
uses: actions/upload-artifact@v4
with:
name: ios-release
path: ./App.ipa
retention-days: 10

4 changes: 2 additions & 2 deletions .github/workflows/build-upload-ios.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build source code on ios
name: Build source code on ios and upload to testflight

on:
pull_request:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
DEMO_USER: ${{ vars.USER_EMAIL }}
DEMO_PASSWORD: ${{ vars.USER_PASSWORD }}
with:
lane: ios beta
lane: ios testflight
- name: Upload release bundle
uses: actions/upload-artifact@v4
with:
Expand Down
28 changes: 27 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,19 @@ end

platform :ios do
desc 'Export ipa and submit to TestFlight'
lane :beta do
lane :production do
keychain_info = { keychain_name: "ios-build-#{Time.now.to_i}.keychain", keychain_password: SecureRandom.uuid }

begin
setup_signing(keychain_info)
bump_build_number
build_app_with_signing(keychain_info)
deliver
ensure
cleanup_keychain(keychain_info)
end
end
lane :testflight do
keychain_info = { keychain_name: "ios-build-#{Time.now.to_i}.keychain", keychain_password: SecureRandom.uuid }

begin
Expand Down Expand Up @@ -317,10 +329,24 @@ platform :ios do
changelog: changelog
# notify_external_testers: true
)
end
private_lane :deliver_production do
api_key = app_store_connect_api_key(
key_id: ENV['APPLE_KEY_ID'],
issuer_id: ENV['APPLE_ISSUER_ID'],
key_content: Base64.decode64(ENV['APPLE_KEY_CONTENT']),
duration: 1200,
in_house: false
)
changelog = read_changelog
deliver(
api_key: api_key,
skip_binary_upload: true,
force: true,
ipa: "./App.ipa",
skip_waiting_for_build_processing: true,
demo_account_required: true,
changelog: changelog,
metadata_path: "./fastlane/metadata/ios",
precheck_include_in_app_purchases: false,
# ignore_language_directory_validation: true,
Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/ios/copyright.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@

2024 Forkbomb B.V.
1 change: 1 addition & 0 deletions fastlane/metadata/ios/primary_category.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

Lifestyle
2 changes: 1 addition & 1 deletion fastlane/metadata/ios/secondary_category.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@

Utilities
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading