forked from horizontalsystems/unstoppable-wallet-android
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (66 loc) · 2.8 KB
/
ci-release-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: ci release workflow
on:
workflow_dispatch:
jobs:
release_build:
runs-on: [self-hosted, linux]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2'
bundler-cache: true
- name: Decode release key
id: releaseKey
uses: timheuer/[email protected]
with:
fileName: "owlwallet-release-key.jks"
fileDir: "../"
encodedString: ${{ secrets.RELEASE_KEY }}
- name: Decode local properties
id: localProperties
uses: timheuer/[email protected]
with:
fileName: 'local.properties'
encodedString: ${{ secrets.LOCAL_PROPERTIES }}
- run: cp "${{ steps.localProperties.outputs.filePath }}" "./"
- name: Decode service credentials file
id: serviceCredentialsFile
uses: timheuer/[email protected]
with:
fileName: 'service_credentials_file_prod.json'
encodedString: ${{ secrets.SERVICE_CREDENTIALS_FILE_PROD }}
- run: cp "${{ steps.serviceCredentialsFile.outputs.filePath }}" "./fastlane"
- name: Decode google-services json file
id: googleServicesJsonFile
uses: timheuer/[email protected]
with:
fileName: 'google-services.json'
encodedString: ${{ secrets.FIREBASE_JSON_BASE64_PROD }}
- run: cp "${{ steps.googleServicesJsonFile.outputs.filePath }}" "./app/src/release"
- name: check googleServicesJsonFile exist
run: ls -al "./app/src/release"
- name: Get the version name
id: versionNameId
run: echo "versionName=$(cat app/build.gradle | grep " versionName " | awk -F '"' '{print $2}')" >> $GITHUB_ENV
- name: Get the version code
id: versionCodeId
run: echo "versionCode=$(cat app/build.gradle | grep " versionCode " | awk '{print $2}')" >> $GITHUB_ENV
- run: bundle exec fastlane prod
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Configure AWS credentials from Production account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1
env:
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
- name: Deploy (Copy files to s3 bucket with the AWS CLI)
run: aws s3 cp app/build/outputs/bundle/release/app-release.aab s3://owlting-qa/owlwallet_android/${{ env.versionName }}.${{ env.versionCode }}/owlwallet-prod-${{ env.versionName }}.${{ env.versionCode }}.aab --acl public-read