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

chore(ci): add ci for Android (Closed Testing) and iOS (TestFlight) Publishing #110

Merged
merged 65 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
eb8f6af
chore: add ci for release
a-ghorbani Nov 20, 2024
af18195
chore: update ci - integrate Identity Federation authentication
a-ghorbani Nov 26, 2024
ccb40fc
chore: test ci
a-ghorbani Nov 26, 2024
26508fa
chore(ci): specify ruby version
a-ghorbani Nov 26, 2024
b84271d
chore: add Ruby dependencies
a-ghorbani Nov 26, 2024
dc411bc
chore(ci): add 'patch' as default for version bump
a-ghorbani Nov 26, 2024
722cfa5
fix(ci): fix bump version fastlane
a-ghorbani Nov 26, 2024
aa16a1a
fix(ci): update version bump parsing in Fastfile
a-ghorbani Nov 26, 2024
2b87395
chore(ci): imporve ci
a-ghorbani Nov 26, 2024
2a7e973
fix(ci): separate android and ios version bump
a-ghorbani Nov 26, 2024
598fa3c
fix(ci): fix bump version issue
a-ghorbani Nov 26, 2024
b7c461d
fix(ci): update android ver bump
a-ghorbani Nov 26, 2024
1bad72c
fix(ci): android version bump
a-ghorbani Nov 26, 2024
a71803f
fix(ci): update bump version ios
a-ghorbani Nov 26, 2024
10399cb
chore(ci): combine ios and android version bump
a-ghorbani Nov 26, 2024
de2f362
fix(ci): add title to commit in push version changes
a-ghorbani Nov 26, 2024
dd12e01
chore(release): bump version to 1.5.1
actions-user Nov 26, 2024
b3f77d1
chore(ci): update release.yml
a-ghorbani Nov 27, 2024
72722ff
Merge remote-tracking branch 'origin/ci/test' into ci/test
a-ghorbani Nov 27, 2024
61bcbbe
chore(release): bump version to 1.5.2
actions-user Nov 27, 2024
f6b1551
chore(ci): update release.tml
a-ghorbani Nov 27, 2024
7b5cbe4
Merge remote-tracking branch 'origin/ci/test' into ci/test
a-ghorbani Nov 27, 2024
9ff5811
chore(release): bump version to 1.5.3
actions-user Nov 27, 2024
89ebe52
chore(ci): add java17
a-ghorbani Nov 27, 2024
5ba8fb8
chore(release): bump version to 1.5.4
actions-user Nov 27, 2024
9002685
chore(ci): fix version code bump
a-ghorbani Nov 27, 2024
1e2469f
chore(release): bump version to 1.5.5
actions-user Nov 27, 2024
bb42f62
fix(ci): uses absolute path in fastfile for keystore.jks
a-ghorbani Nov 28, 2024
2b11486
chore(release): bump version to 1.5.6
actions-user Nov 28, 2024
c490261
fix(ci): update android_dir
a-ghorbani Nov 28, 2024
eca657f
chore(release): bump version to 1.5.7
actions-user Nov 28, 2024
f4f8253
fix(ci): update fastfile with credentials file
a-ghorbani Nov 28, 2024
95118a4
chore(release): bump version to 1.5.8
actions-user Nov 28, 2024
d4c6ba5
fix(ci): add json key
a-ghorbani Nov 28, 2024
714c755
chore(release): bump version to 1.5.9
actions-user Nov 28, 2024
de81c0c
fix(ci): add package name to fastfile for android
a-ghorbani Nov 28, 2024
1505ae7
Merge remote-tracking branch 'origin/ci/test' into ci/test
a-ghorbani Nov 28, 2024
16bdbb7
chore(release): bump version to 1.5.10
actions-user Nov 28, 2024
5a59f8a
chore(ci): nothing just trigger ci
a-ghorbani Nov 28, 2024
9836922
chore(release): bump version to 1.5.11
actions-user Nov 28, 2024
49ae8b5
chore(ci): nothing just triggering ci
a-ghorbani Nov 28, 2024
cb9711a
chore(release): bump version to 1.5.12
actions-user Nov 28, 2024
3b0cf45
fix(ci): use com.pocketpalai for the package name for upload to play …
a-ghorbani Nov 28, 2024
d798a86
Merge remote-tracking branch 'origin/ci/test' into ci/test
a-ghorbani Nov 28, 2024
84f6f70
chore(release): bump version to 1.5.13
actions-user Nov 28, 2024
2dcc817
fix(ci): ios fastfile update
a-ghorbani Nov 28, 2024
bcb9c0c
chore(release): bump version to 1.5.14
actions-user Nov 28, 2024
f7aa62d
chore(ci): add matfile for ios
a-ghorbani Nov 28, 2024
9e59fa8
Merge remote-tracking branch 'origin/ci/test' into ci/test
a-ghorbani Nov 28, 2024
23b8022
chore(release): bump version to 1.5.15
actions-user Nov 28, 2024
58f98f2
chore(ci): remove match password from match
a-ghorbani Nov 28, 2024
7bf8c14
chore(release): bump version to 1.5.16
actions-user Nov 28, 2024
6d02cf3
chore(ci): encode github toke
a-ghorbani Nov 28, 2024
5db9795
chore(release): bump version to 1.5.17
actions-user Nov 28, 2024
958c2db
fix(ci): keep fixing ios
a-ghorbani Nov 28, 2024
8db7d3a
chore(release): bump version to 1.5.18
actions-user Nov 28, 2024
e05647f
chore: keep fixing ios
a-ghorbani Nov 28, 2024
19d5681
Merge remote-tracking branch 'origin/ci/test' into ci/test
a-ghorbani Nov 28, 2024
d7e0db4
chore: merge ver bump
a-ghorbani Nov 28, 2024
de12ea8
chore(ci): add export_options to build_ios
a-ghorbani Nov 28, 2024
ae6c0eb
chore(release): bump version to 1.5.19
actions-user Nov 28, 2024
3509209
chore(ci): add setup_ci to fix freeze at [CP] Embed Pods Frameworks
a-ghorbani Nov 29, 2024
bea4ecb
chore(release): bump version to 1.5.20
actions-user Nov 29, 2024
828ba3b
chore(ci): remove trigger on push
a-ghorbani Nov 29, 2024
d40002c
chore: merge branch 'main' into ci/test
a-ghorbani Nov 29, 2024
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
158 changes: 131 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,150 @@
name: Release
name: Release Workflow

on:
push:
branches:
- main
workflow_dispatch:
inputs:
version_type:
description: "Type of version bump (major, minor, patch, premajor, preminor, prepatch, prerelease)"
required: true
default: "patch"
type: choice
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease

jobs:
release:
# Job 1: Version Bumping and Android Build
build_android:
runs-on: ubuntu-latest
permissions:
contents: 'write' # Allows workflow to checkout repository code
id-token: 'write' # Required for Google Cloud Workload Identity Federation authentication (OIDC token generation)

steps:
# Step 1: Check out the repository
- name: Check out code
uses: actions/checkout@v3
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Node.js
# Step 2: Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

# Step 3: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20.18.0' # Use the specified Node.js version
cache: 'yarn'

# Step 3: Install dependencies
# Step 4: Install dependencies using Yarn
- name: Install dependencies
run: yarn install

# Step 4: Run release-please to create a release PR with version bump and changelog
- name: Run release-please
uses: google-github-actions/release-please-action@v3
# Step 5: Set up Ruby and Bundler
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
release-type: node
package-name: your-app-name
ruby-version: '3.2.3' # Specify a Ruby version
bundler-cache: true

# Step 6: Combined version bump
- name: Bump versions
working-directory: ${{ github.workspace }}
run: bundle exec fastlane bump_version version_type:${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version_type || 'patch' }}

# Step 7: Commit and push version changes
- name: Commit and push version changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add .version package.json android/app/build.gradle ios/PocketPal.xcodeproj/project.pbxproj
git commit -m "chore(release): bump version to $(cat .version)"
git push
git tag "v$(cat .version)"
git push origin "v$(cat .version)"

# Step 5: Sync iOS and Android versions using react-native-version
- name: Sync iOS and Android versions
# Step 8: Set up Android Keystore
- name: Set up Android Keystore
working-directory: android
run: |
CURRENT_VERSION=$(cat package.json | grep version | head -n 1 | awk -F: '{ print $2 }' | sed 's/[",]//g')
yarn react-native-version --target $CURRENT_VERSION
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > keystore.jks

# Step 9: Authenticate to Google Cloud
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
create_credentials_file: true

# Step 6: Commit the iOS and Android version bumps
- name: Commit version updates
# Step 10: Build and upload Android app to Alpha track
- name: Build and upload Android app
working-directory: android
env:
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
GRADLE_USER_HOME: ${{ runner.temp }}/.gradle
# GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }} # This is not supported by fastlane, we need to replace it with PLAY_STORE_JSON_KEY in the future.
PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_JSON }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "chore(release): sync iOS and Android versions"
git push origin main
echo "$PLAY_STORE_JSON_KEY" > play-store-key.json
bundle exec fastlane release_android_alpha

# Job 2: iOS Build and Upload (runs on macOS)
build_ios:
runs-on: macos-latest
needs: build_android

steps:
- name: Checkout code # Replace the Download code step
uses: actions/checkout@v3
with:
ref: ${{ github.ref }} # This ensures we get the latest changes including the version bump

# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.18.0'
cache: 'yarn'

# Step 3: Install dependencies using Yarn
- name: Install dependencies
run: yarn install

# Step 4: Set up Ruby and Bundler
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.3' # Specify a Ruby version
bundler-cache: true

# Step 5: Install CocoaPods dependencies
- name: Install CocoaPods dependencies
working-directory: ios
run: pod install

# Step 6: Build and upload iOS app to TestFlight
- name: Build and upload iOS app
working-directory: ios
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_GITHUB_TOKEN: ${{ secrets.MATCH_GITHUB_TOKEN }}
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}
APP_STORE_CONNECT_USER_ID: ${{ secrets.APP_STORE_CONNECT_USER_ID }}
run: bundle exec fastlane release_ios
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.20
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ ruby "3.2.3"
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

# Fastlane
gem "fastlane"
gem "fastlane-plugin-versioning"
gem 'fastlane-plugin-versioning_android'
Loading