Skip to content

Commit

Permalink
separate workflows into build and deploy sections
Browse files Browse the repository at this point in the history
  • Loading branch information
SwenVanZanten committed Jul 5, 2021
1 parent 0593765 commit 3306a3b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 64 deletions.
43 changes: 16 additions & 27 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: 🤖 Android CI/CD
name: Android

on: [push, pull_request]

jobs:
build:
if: startsWith(github.ref, 'refs/tags/') != true
runs-on: ubuntu-latest

steps:
Expand All @@ -27,39 +26,29 @@ jobs:
distribution: 'zulu'
java-version: 8
- name: Build with Gradle
run: ./gradlew build
run: ./gradlew bundleRelease
working-directory: ./android
- name: Upload Release Artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: android-release
path: ${{ github.workspace }}/android/app/build/outputs/bundle/release/app-release.aab

deploy:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache modules
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js
uses: actions/setup-node@v2
- name: Download Release Artifact
uses: actions/download-artifact@v2
with:
node-version: 16.x
- name: Install Yarn Modules
run: yarn
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- name: Build with Gradle
run: ./gradlew bundleRelease
working-directory: ${{ github.workspace }}/android
name: android-release
- name: Sign Release
uses: r0adkll/sign-android-release@v1
id: sign_app
id: sign
with:
releaseDirectory: ${{ github.workspace }}/android/app/build/outputs/bundle/release
releaseDirectory: ${{ github.workspace }}
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_SIGNING_KEY_STORE_PASSWORD }}
Expand All @@ -71,12 +60,12 @@ jobs:
with:
serviceAccountJsonPlainText: ${{ secrets.ANDROID_UPLOAD_SERVICE_ACCOUNT_JSON }}
packageName: com.multicash
releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }}
releaseFiles: ${{ steps.sign.outputs.signedReleaseFile }}
track: alpha
inAppUpdatePriority: 2
- name: Upload Release to GitHub
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.sign_app.outputs.signedReleaseFile }}
files: ${{ steps.sign.outputs.signedReleaseFile }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 17 additions & 35 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: 📱 iOS CI/CD
name: iOS

on: [push, pull_request]

jobs:
build:
if: startsWith(github.ref, 'refs/tags/') != true
runs-on: macOS-latest

steps:
Expand All @@ -29,55 +28,38 @@ jobs:
with:
project-path: ${{ github.workspace }}/ios/MultiCash.xcodeproj
workspace-path: ${{ github.workspace }}/ios/MultiCash.xcworkspace
output-path: ${{ github.workspace }}/ios/app-release.ipa
p12-base64: ${{ secrets.IOS_P12_BASE64 }}
certificate-password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
mobileprovision-base64: ${{ secrets.IOS_MOBILEPROVISION_BASE64 }}
code-signing-identity: ${{ secrets.IOS_CODE_SIGNING_IDENTITY }}
team-id: ${{ secrets.IOS_TEAM_ID }}
export-method: package
configuration: Debug
export-method: app-store
configuration: Release
scheme: MultiCash
- name: Upload Release Artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: iOS-release
path: ${{ github.workspace }}/ios/app-release.ipa

deploy:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: macOS-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache modules
uses: actions/cache@v2
- name: Download Release Artifact
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Install Yarn Modules
run: yarn
- name: Install iOS Cocoa Pods
run: pod install
working-directory: ios
- name: Build with Fastlane
uses: yukiarrr/[email protected]
with:
project-path: ${{ github.workspace }}/ios/MultiCash.xcodeproj
workspace-path: ${{ github.workspace }}/ios/MultiCash.xcworkspace
output-path: ${{ github.workspace }}/ios/app-release.ipa
p12-base64: ${{ secrets.IOS_P12_BASE64 }}
certificate-password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
mobileprovision-base64: ${{ secrets.IOS_MOBILEPROVISION_BASE64 }}
code-signing-identity: ${{ secrets.IOS_CODE_SIGNING_IDENTITY }}
team-id: ${{ secrets.IOS_TEAM_ID }}
export-method: app-store
configuration: Release
scheme: MultiCash
name: iOS-release
- name: Upload to App Store Connect
run: |
xcrun altool --upload-app -t ios -f "${{ github.workspace }}/ios/app-release.ipa" -u "${{ secrets.IOS_UPLOAD_USER }}" -p "${{ secrets.IOS_UPLOAD_PASSWORD }}"
xcrun altool --upload-app -t ios -f "${{ github.workspace }}/app-release.ipa" -u "${{ secrets.IOS_UPLOAD_USER }}" -p "${{ secrets.IOS_UPLOAD_PASSWORD }}"
- name: Upload Release to GitHub
uses: softprops/action-gh-release@v1
with:
files: ${{ github.workspace }}/ios/app-release.ipa
files: ${{ github.workspace }}/app-release.ipa
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 🛠 Tests Suite
name: Tests

on: [push, pull_request]

jobs:
build:
test:
if: startsWith(github.ref, 'refs/tags/') != true
runs-on: ubuntu-latest

Expand Down

0 comments on commit 3306a3b

Please sign in to comment.