Created
September 8, 2021 12:53
-
-
Save mondoktamas/4e44836b219d6f3f910e3092da509182 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Android Release | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- develop | |
- master | |
types: [closed, opened, reopened, synchronize] | |
jobs: | |
deploy_android: | |
if: ${{ (github.base_ref == 'develop' && github.event.pull_request.merged == true) || github.base_ref == 'master' || github.event_name == 'workflow_dispatch' }} | |
env: | |
BUILD_NUMBER_OFFSET: 170 | |
NDK_VERSION: "21.4.7075529" | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.6.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Asses Build Number | |
run: | | |
echo BuildNumber : `expr $GITHUB_RUN_NUMBER + $BUILD_NUMBER_OFFSET` | |
- name: Check out repo | |
uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 14.x | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v1.4.0 | |
with: | |
flutter-version: 2.2.1 | |
channel: stable | |
- name: Set up service_account JSON | |
env: | |
PLAY_STORE_SERVICE_JSON: ${{ secrets.PLAY_STORE_SERVICE_JSON }} | |
run: echo "$PLAY_STORE_SERVICE_JSON" | base64 -d > android/service_account.json | |
- name: Set up release Key | |
env: | |
KEY: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
run: echo "$KEY" | base64 -d > android/release-key.jks | |
- name: Set Up Release Key Props | |
env: | |
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
run: | | |
echo storePassword=$KEYSTORE_PASSWORD >> android/release-key.properties | |
echo keyPassword=$KEYSTORE_PASSWORD >> android/release-key.properties | |
echo keyAlias=key0 >> android/release-key.properties | |
echo storeFile=../release-key.jks >> android/release-key.properties | |
- name: Deploy & Build with Fastlane | |
uses: maierj/fastlane-action@v1.4.0 | |
with: | |
lane: beta build_number:`expr $GITHUB_RUN_NUMBER + $BUILD_NUMBER_OFFSET` | |
subdirectory: android | |
- name: Commit Changes to dev | |
if: ${{ github.base_ref == 'develop' && github.event.pull_request.merged == true }} | |
uses: EndBug/add-and-commit@v6 | |
with: | |
branch: develop | |
add: 'pubspec.lock' | |
message: 'Automated: Pub Upgrade' | |
token: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment