Merge pull request #68 from akaMrNagar/dev #8
Workflow file for this run
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: Build and Deploy to Play Store | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
- run: flutter --version | |
- name: Reconstruct Keystore File | |
run: | | |
echo ${{ secrets.KEYSTORE_BASE64 }} | base64 --decode > $HOME/keystore.jks | |
echo "KEYSTORE_FILE=$HOME/keystore.jks" >> $GITHUB_ENV | |
- name: Set up environment for signing | |
run: | | |
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> $GITHUB_ENV | |
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV | |
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> $GITHUB_ENV | |
- name: Extract version from tag | |
id: extract_version | |
run: | | |
TAG=${GITHUB_REF#refs/tags/} | |
VERSION=${TAG#v} | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Update pubspec.yaml | |
run: | | |
cd $GITHUB_WORKSPACE | |
sed -i "s/^version: .*/version: ${{ env.VERSION }}/" pubspec.yaml | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build AAB | |
run: flutter build appbundle --release | |
- name: Upload AAB to Play Store | |
id: upload_google_play | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
packageName: ${{ secrets.PACKAGE_NAME }} | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
inAppUpdatePriority: ${{ secrets.UPDATE_PRIORITY }} # Between 0-5 => Higher the number, higher the priority. | |
releaseFiles: build/app/outputs/bundle/release/app-release.aab | |
mappingFile: build/app/outputs/mapping/release/mapping.txt | |
debugSymbols: build/app/intermediates/merged_native_libs/release/out/lib | |
track: internal | |
status: draft | |
# changesNotSentForReview: ${{ secrets.DONT_SEND_CHANGES_FOR_REVIEW }} # true or false | |
- name: Cleanup | |
run: | | |
echo "Cleaning up temporary files..." | |
rm -rf build | |
rm $HOME/keystore.jks | |
echo "Cleanup complete." |