Skip to content

Feat: release

Feat: release #45

Workflow file for this run

name: Build and deploy for prod
on: [push]
jobs:
android-build:
name: Android main Build
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Checkout repo from main branch
uses: actions/[email protected]
with:
ref: build-test
- name: Install npm dependency
run: npm install
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Setup Android SDK
uses: android-actions/[email protected]
- uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Decode Keystore
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
MYAPP_UPLOAD_STORE_FILE: ${{ secrets.MYAPP_UPLOAD_STORE_FILE }}
run: |
cd android/app
echo $KEYSTORE > keystore-b64.txt
base64 -d keystore-b64.txt > $MYAPP_UPLOAD_STORE_FILE
- name: Build Release apk
env:
MYAPP_UPLOAD_STORE_FILE: ${{ secrets.MYAPP_UPLOAD_STORE_FILE }}
MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
run: |
cd android
./gradlew assembleRelease
- name: Build Release bundle
env:
MYAPP_UPLOAD_STORE_FILE: ${{ secrets.MYAPP_UPLOAD_STORE_FILE }}
MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
run: |
cd android
./gradlew bundleRelease
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v1.0.0 # Specify your tag name
release_name: Release v1.0.0 # Specify your release name
body: |
Describe your release here
You can use Markdown syntax
draft: false
prerelease: false
files: |
./android/app/build/outputs/bundle/release/app-release.aab
# - name: list
# run: |
# cd android/app
# ls
# cd build
# ls
# cd outputs
# ls
# ls bundle/release
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# - First Change
# - Second Change
# draft: false
# prerelease: false
# ios-build:
# name: iOS main Build
# runs-on: self-hosted
# steps:
# - name: Show self-hosted machine infomation
# run: uname -a
# - name: Cancel previous runs
# uses: styfle/[email protected]
# - name: Checkout repo from main branch
# uses: actions/checkout@v3
# with:
# ref: main
# - name: Install npm dependency
# run: yarn install
# - name: Cache cocoapods
# uses: actions/cache@v3
# with:
# path: /ios/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Install pod dependency
# run: |
# cd ios
# bundle exec pod install
# - name: Build iOS JS Bundle
# run: |
# yarn run package-ios
# - name: Install bundler
# run: |
# cd ios
# gem install bundler
# - name: Install gem plugins
# run: |
# cd ios
# bundle install
# - name: Run fastlane
# run: |
# cd ios
# bundle exec fastlane build_testflight