Skip to content

ci release workflow #59

ci release workflow

ci release workflow #59

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